3v4l.org

run code in 200+ php & hhvm versions
```<?php \$links = array( null => array(1, 2, 3, 4, 5), 2 => array(6, 7, 8, 9), 3 => array(10, 11), 10 => array(12), 12 => array(13) ); \$nodes = array( 1 => array( "title" => 1, ), 2 => array( "title" => 2, ), 3 => array( "title" => 3, ), 4 => array( "title" => 4, ), 5 => array( "title" => 5, ), 6 => array( "title" => 6, ), 7 => array( "title" => 7, ), 8 => array( "title" => 8, ), 9 => array( "title" => 9, ), 10 => array( "title" => 10, ), 11 => array( "title" => 11, ), 12 => array( "title" => 12, ), 13 => array( "title" => 13, ), ); function f(\$node, \$nodes, \$links) { if (!isset(\$nodes[\$node]["children"])) { \$nodes[\$node]["children"] = array(); } if (isset(\$links[\$node])) { foreach(\$links[\$node] as \$child) { array_push(\$nodes[\$node]["children"], f(\$child)); } } return \$nodes[\$node]; } f(null, \$nodes, \$links); print_r(\$nodes[null]["children"]);```
based on M0skj
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function f(), 1 passed in /in/ZWbpZ on line 61 and exactly 3 expected in /in/ZWbpZ:53 Stack trace: #0 /in/ZWbpZ(61): f(1) #1 /in/ZWbpZ(68): f(NULL, Array, Array) #2 {main} thrown in /in/ZWbpZ on line 53
Process exited with code 255.
Output for 5.3.17 - 7.0.20
Warning: Missing argument 2 for f(), called in /in/ZWbpZ on line 61 and defined in /in/ZWbpZ on line 53 Warning: Missing argument 3 for f(), called in /in/ZWbpZ on line 61 and defined in /in/ZWbpZ on line 53 Warning: Missing argument 2 for f(), called in /in/ZWbpZ on line 61 and defined in /in/ZWbpZ on line 53 Warning: Missing argument 3 for f(), called in /in/ZWbpZ on line 61 and defined in /in/ZWbpZ on line 53 Warning: Missing argument 2 for f(), called in /in/ZWbpZ on line 61 and defined in /in/ZWbpZ on line 53 Warning: Missing argument 3 for f(), called in /in/ZWbpZ on line 61 and defined in /in/ZWbpZ on line 53 Warning: Missing argument 2 for f(), called in /in/ZWbpZ on line 61 and defined in /in/ZWbpZ on line 53 Warning: Missing argument 3 for f(), called in /in/ZWbpZ on line 61 and defined in /in/ZWbpZ on line 53 Warning: Missing argument 2 for f(), called in /in/ZWbpZ on line 61 and defined in /in/ZWbpZ on line 53 Warning: Missing argument 3 for f(), called in /in/ZWbpZ on line 61 and defined in /in/ZWbpZ on line 53 Notice: Undefined index: in /in/ZWbpZ on line 70