public function addChild(string $key) : NodePath
    {
        $path = $this->path;
        $path[] = $key;
        return new NodePath($path);
    }
public function addChild(string $key) : NodePath
    {
        $path = $this->path;
        $path[] = $key;
        return new NodePath($path);
    }
public function addChild ( string $ key ) : NodePath { $ path = $ this -> path ; $ path [ ] = $ key ; return new NodePath ( $ path ) ; }
Return new path with an added child.
@param string $key
@return NodePath
Return new path with an added child .