3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function test() { $x = array_merge(array(1,2,3), (array) func_get_arg(0)); echo print_r($x, 1), "\n"; } test(); test(5);
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Warning: func_get_arg(): Argument 0 not passed to function in /in/lGFIn on line 4 Array ( [0] => 1 [1] => 2 [2] => 3 [3] => ) Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 5 )
Output for 4.3.2 - 5.2.17
Fatal error: func_get_arg(): Can't be used as a function parameter in /in/lGFIn on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: func_get_arg(): Can't be used as a function parameter in /in/lGFIn on line 4