public function walkNodes(callable $fn)
    {
        foreach ($this->_children as $node) {
            $node->walkNodes($fn);
        }
        $fn($this);
    }
public function walkNodes(callable $fn)
    {
        foreach ($this->_children as $node) {
            $node->walkNodes($fn);
        }
        $fn($this);
    }
public function walkNodes ( callable $ fn ) { foreach ( $ this -> _children as $ node ) { $ node -> walkNodes ( $ fn ) ; } $ fn ( $ this ) ; }
Walk tree from this node, applying a callback for each node.

Nodes are traversed depth-first and callback shall be applied post-order.

@param callable $fn
Walk tree from this node applying a callback for each node .