3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test(callable $test) { var_dump($test); } test(function () {}); test('rand'); test(create_function('', '')); test([new SplFixedArray, 'count']);
based on FfZsF
Output for 7.2.0
object(Closure)#1 (0) { } string(4) "rand" Deprecated: Function create_function() is deprecated in /in/nekRR on line 9 string(9) "lambda_1" array(2) { [0]=> object(SplFixedArray)#1 (0) { } [1]=> string(5) "count" }
Output for 5.4.1 - 7.1.10
object(Closure)#1 (0) { } string(4) "rand" string(9) "lambda_1" array(2) { [0]=> object(SplFixedArray)#1 (0) { } [1]=> string(5) "count" }
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[', expecting ')' in /in/nekRR on line 10
Process exited with code 255.