3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $foo = function($var1, $var2) { var_dump($var1, $var2); }; call_user_func($foo, ['bar', 'baz']);
based on 8qqPT
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 1 passed in /in/b23f2 on line 7 and exactly 2 expected in /in/b23f2:3 Stack trace: #0 /in/b23f2(7): {closure}(Array) #1 {main} thrown in /in/b23f2 on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: Missing argument 2 for {closure}(), called in /in/b23f2 on line 7 and defined in /in/b23f2 on line 3 Notice: Undefined variable: var2 in /in/b23f2 on line 4 array(2) { [0]=> string(3) "bar" [1]=> string(3) "baz" } NULL
Output for 5.4.0 - 5.6.28
Warning: Missing argument 2 for {closure}() in /in/b23f2 on line 3 Notice: Undefined variable: var2 in /in/b23f2 on line 4 array(2) { [0]=> string(3) "bar" [1]=> string(3) "baz" } NULL
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/b23f2 on line 7
Process exited with code 255.