Display the entire tree (This is a fully recursive tree that can be looked up at any point)
Tree Object
(
[length] => 3
[1] => Node Object
(
[id] => 1
[name] => somename1
[parent] =>
[depth] =>
[children] => NodeList Object
(
[length] => 1
[53] => Node Object
(
[id] => 53
[name] => somename2
[parent] => 1
[depth] =>
[children] => NodeList Object
(
[length] => 1
[921] => Node Object
(
[id] => 921
[name] => somename3
[parent] => 53
[depth] =>
[children] => NodeList Object
(
[length] => 0
)
[baz] => baz
)
)
[bar] => bar
)
)
[foo] => foo
)
[53] => Node Object
(
[id] => 53
[name] => somename2
[parent] => 1
[depth] =>
[children] => NodeList Object
(
[length] => 1
[921] => Node Object
(
[id] => 921
[name] => somename3
[parent] => 53
[depth] =>
[children] => NodeList Object
(
[length] => 0
)
[baz] => baz
)
)
[bar] => bar
)
[921] => Node Object
(
[id] => 921
[name] => somename3
[parent] => 53
[depth] =>
[children] => NodeList Object
(
[length] => 0
)
[baz] => baz
)
)
Get the middle node id 53
Node Object
(
[id] => 53
[name] => somename2
[parent] => 1
[depth] =>
[children] => NodeList Object
(
[length] => 1
[921] => Node Object
(
[id] => 921
[name] => somename3
[parent] => 53
[depth] =>
[children] => NodeList Object
(
[length] => 0
)
[baz] => baz
)
)
[bar] => bar
)
Get the child count of node id 53: 1
Get the children of node 1:
NodeList Object
(
[length] => 1
[53] => Node Object
(
[id] => 53
[name] => somename2
[parent] => 1
[depth] =>
[children] => NodeList Object
(
[length] => 1
[921] => Node Object
(
[id] => 921
[name] => somename3
[parent] => 53
[depth] =>
[children] => NodeList Object
(
[length] => 0
)
[baz] => baz
)
)
[bar] => bar
)
)
Get the depth of the tree node id 921: 2
Get the depth of the tree node id 53: 1
Remove the children of node id 53:
Node Object
(
[id] => 53
[name] => somename2
[parent] => 1
[depth] => 1
[children] =>
[bar] => bar
)
Display the list of nodes after removing the children of node id 53:
Tree Object
(
[length] => 3
[1] => Node Object
(
[id] => 1
[name] => somename1
[parent] =>
[depth] => 0
[children] => NodeList Object
(
[length] => 1
[53] => Node Object
(
[id] => 53
[name] => somename2
[parent] => 1
[depth] => 1
[children] =>
[bar] => bar
)
)
[foo] => foo
)
[53] => Node Object
(
[id] => 53
[name] => somename2
[parent] => 1
[depth] => 1
[children] =>
[bar] => bar
)
[921] => Node Object
(
[id] => 921
[name] => somename3
[parent] => 53
[depth] => 2
[children] =>
[baz] => baz
)
)
Output for 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/PgqlG on line 247
Display the entire tree (This is a fully recursive tree that can be looked up at any point)PHP_EOLTree Object
(
[length] => 3
[1] => Node Object
(
[id] => 1
[name] => somename1
[parent] =>
[depth] =>
[children] => NodeList Object
(
[length] => 1
[53] => Node Object
(
[id] => 53
[name] => somename2
[parent] => 1
[depth] =>
[children] => NodeList Object
(
[length] => 1
[921] => Node Object
(
[id] => 921
[name] => somename3
[parent] => 53
[depth] =>
[children] => NodeList Object
(
[length] => 0
)
[baz] => baz
)
)
[bar] => bar
)
)
[foo] => foo
)
[53] => Node Object
(
[id] => 53
[name] => somename2
[parent] => 1
[depth] =>
[children] => NodeList Object
(
[length] => 1
[921] => Node Object
(
[id] => 921
[name] => somename3
[parent] => 53
[depth] =>
[children] => NodeList Object
(
[length] => 0
)
[baz] => baz
)
)
[bar] => bar
)
[921] => Node Object
(
[id] => 921
[name] => somename3
[parent] => 53
[depth] =>
[children] => NodeList Object
(
[length] => 0
)
[baz] => baz
)
)
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/PgqlG on line 249
PHP_EOL
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/PgqlG on line 251
Get the middle node id 53PHP_EOLNode Object
(
[id] => 53
[name] => somename2
[parent] => 1
[depth] =>
[children] => NodeList Object
(
[length] => 1
[921] => Node Object
(
[id] => 921
[name] => somename3
[parent] => 53
[depth] =>
[children] => NodeList Object
(
[length] => 0
)
[baz] => baz
)
)
[bar] => bar
)
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/PgqlG on line 253
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/PgqlG on line 253
PHP_EOLPHP_EOLGet the child count of node id 53: 1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/PgqlG on line 256
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/PgqlG on line 256
PHP_EOLPHP_EOL
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/PgqlG on line 258
Get the children of node 1: PHP_EOLNodeList Object
(
[length] => 1
[53] => Node Object
(
[id] => 53
[name] => somename2
[parent] => 1
[depth] =>
[children] => NodeList Object
(
[length] => 1
[921] => Node Object
(
[id] => 921
[name] => somename3
[parent] => 53
[depth] =>
[children] => NodeList Object
(
[length] => 0
)
[baz] => baz
)
)
[bar] => bar
)
)
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/PgqlG on line 260
PHP_EOLGet the depth of the tree node id 921: 2
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/PgqlG on line 263
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/PgqlG on line 263
PHP_EOLPHP_EOLGet the depth of the tree node id 53: 1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/PgqlG on line 266
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/PgqlG on line 266
PHP_EOLPHP_EOL
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/PgqlG on line 268
Remove the children of node id 53:PHP_EOLNode Object
(
[id] => 53
[name] => somename2
[parent] => 1
[depth] => 1
[children] =>
[bar] => bar
)
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/PgqlG on line 270
PHP_EOL
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/PgqlG on line 272
Display the list of nodes after removing the children of node id 53:PHP_EOLTree Object
(
[length] => 3
[1] => Node Object
(
[id] => 1
[name] => somename1
[parent] =>
[depth] => 0
[children] => NodeList Object
(
[length] => 1
[53] => Node Object
(
[id] => 53
[name] => somename2
[parent] => 1
[depth] => 1
[children] =>
[bar] => bar
)
)
[foo] => foo
)
[53] => Node Object
(
[id] => 53
[name] => somename2
[parent] => 1
[depth] => 1
[children] =>
[bar] => bar
)
[921] => Node Object
(
[id] => 921
[name] => somename3
[parent] => 53
[depth] => 2
[children] =>
[baz] => baz
)
)
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/PgqlG on line 10
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/PgqlG on line 10
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/PgqlG on line 10
Process exited with code 255.