3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $actions = array( '*' => 'multiply', '/' => 'divide' ); function dontSwitch($option) { return call_user_func($actions[$option]); } function multiply() { return 'fuuuuu'; } function divide() { return 'dump'; } echo dontSwitch('*');
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: actions in /in/YBvBJ on line 7 Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in /in/YBvBJ on line 7
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: actions in /in/YBvBJ on line 7 Warning: Invalid argument: function: not string, closure, or array in /in/YBvBJ on line 7
Output for 5.0.4 - 5.2.17
Notice: Undefined variable: actions in /in/YBvBJ on line 7 Warning: call_user_func(): First argument is expected to be a valid callback in /in/YBvBJ on line 7
Output for 4.3.2 - 5.0.3
Notice: Undefined variable: actions in /in/YBvBJ on line 7 Warning: call_user_func(): First argument is expected to be a valid callback in /in/YBvBJ on line 7
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: actions in /in/YBvBJ on line 7 Warning: call_user_func() [http://www.php.net/function.call-user-func]: First argument is expected to be a valid callback in /in/YBvBJ on line 7