public function getChild($index) { if (isset($this->nodes[$index])) { return $this->nodes[$index]; } throw new \OutOfBoundsException(sprintf('No node found at index %d in node of type: %s', $index, get_class($this))); }