Parser/Node.php
public function dump($level = 0)
    {

        $export = implode(' ', array_map(function ($key, $value) {

            $str = '';
            if (!is_numeric($key))
                $str .= "$key=";

            if ($value)
                $str .= !is_array($value)
                    ? $value
                    : '{'.implode(', ', array_map('trim', array_map('strval', $value))).'}';

            return $str;
        }, array_keys($this->data), $this->data));

        $indent = str_repeat('    ', $level);
        $str = $indent.'['.$this->type.(empty($export) ? '' : " $export").']'."\n";
        foreach ($this->children as $child)
            $str .= $child->dump($level + 1);

        return trim($str);
    }
public function dump($level = 0)
    {

        $export = implode(' ', array_map(function ($key, $value) {

            $str = '';
            if (!is_numeric($key))
                $str .= "$key=";

            if ($value)
                $str .= !is_array($value)
                    ? $value
                    : '{'.implode(', ', array_map('trim', array_map('strval', $value))).'}';

            return $str;
        }, array_keys($this->data), $this->data));

        $indent = str_repeat('    ', $level);
        $str = $indent.'['.$this->type.(empty($export) ? '' : " $export").']'."\n";
        foreach ($this->children as $child)
            $str .= $child->dump($level + 1);

        return trim($str);
    }
public function dump ( $ level = 0 ) { $ export = implode ( ' ' , array_map ( function ( $ key , $ value ) { $ str = '' ; if ( ! is_numeric ( $ key ) ) $ str .= "$key=" ; if ( $ value ) $ str .= ! is_array ( $ value ) ? $ value : '{' . implode ( ', ' , array_map ( 'trim' , array_map ( 'strval' , $ value ) ) ) . '}' ; return $ str ; } , array_keys ( $ this -> data ) , $ this -> data ) ) ; $ indent = str_repeat ( '    ' , $ level ) ; $ str = $ indent . '[' . $ this -> type . ( empty ( $ export ) ? '' : " $export" ) . ']' . "\n" ; foreach ( $ this -> children as $ child ) $ str .= $ child -> dump ( $ level + 1 ) ; return trim ( $ str ) ; }
Dumps the node as a string to ease up debugging.

This is also the default-action for __toString on every node

The result will look like this:

[element tag=a expands=[element tag=b]]
[element tag=c attributes={[attribute name=d name=e]}]

@param int $level the initial indentation level

@return string the string to debug the node-tree
Dumps the node as a string to ease up debugging .