Parser/Node.php
public function prepend(Node $node)
    {

        array_unshift($this->children, $node);
        $node->parent = $this;

        return $this;
    }
public function prepend(Node $node)
    {

        array_unshift($this->children, $node);
        $node->parent = $this;

        return $this;
    }
public function prepend ( Node $ node ) { array_unshift ( $ this -> children , $ node ) ; $ node -> parent = $ this ; return $ this ; }
Prepends the given node to this node's children.

This also sets the parent of the given child to this node

[element:a]
(0)[element:b]
(1)[element:c]

[element:a]->prepend([element:d])

[element:a]
(0)[element:d]
(1)[element:b]
(2)[element:c]

@param Node $node the new child node to be prepended

@return $this
Prepends the given node to this node s children .