3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = function foo(){}; $y = function foo2($x){echo 'foo';}; $z = function bar($x){echo 'bar';}; var_dump(array_search($x, array($x,$y,$z), false)); var_dump(array_search($y, array($x,$y,$z), false)); var_dump(array_search($z, array($x,$y,$z), false)); var_dump(array_search(function foo(){}, array($x,$y,$z), false));
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected 'foo' (T_STRING), expecting '(' in /in/RnIno on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting '(' in /in/RnIno on line 3
Process exited with code 255.