3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { function fun($bar) { echo "fooo" . $bar; } } $parts = ['Foo', 'fun']; $controller = array_shift($parts); $method = array_shift($parts); call_user_func_array([new $controller, $method], $parts);
based on 2Prss
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Foo::fun(), 0 passed in /in/M3KTQ on line 13 and exactly 1 expected in /in/M3KTQ:4 Stack trace: #0 /in/M3KTQ(13): Foo->fun() #1 {main} thrown in /in/M3KTQ on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: Missing argument 1 for Foo::fun(), called in /in/M3KTQ on line 13 and defined in /in/M3KTQ on line 4 Notice: Undefined variable: bar in /in/M3KTQ on line 5 fooo
Output for 5.4.1 - 5.6.28
Warning: Missing argument 1 for Foo::fun() in /in/M3KTQ on line 4 Notice: Undefined variable: bar in /in/M3KTQ on line 5 fooo
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/M3KTQ on line 9
Process exited with code 255.