AbstractNode::getChild

The getChild() method retrieves the child node at a specified offset. This allows you to access a particular child node by its position in the parent's NodeList.

If the provided offset is invalid (either negative or beyond range), this method will return null.

Description

public AbstractNode::getChild(int $offset): ?NodeInterface

Parameters

offset

The position (zero-based index) of the child node to retrieve.

Return Value

The child node instance at the specified offset or null if the offset is out of bounds.

Exceptions

None

Source Code
If you find this project useful, consider leaving a on GitHub! Thank you!