3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class foo { function bar($arg1, $arg2) { echo $arg1 . '-' . $arg2; } } $a = array(new foo, 'bar'); $a();
based on Vv843
Output for 7.1.0 - 7.2.6
Fatal error: Uncaught ArgumentCountError: Too few arguments to function foo::bar(), 0 passed in /in/PZvHU on line 16 and exactly 2 expected in /in/PZvHU:6 Stack trace: #0 /in/PZvHU(16): foo->bar() #1 {main} thrown in /in/PZvHU on line 6
Process exited with code 255.
Output for 5.4.0 - 7.0.20
Warning: Missing argument 1 for foo::bar(), called in /in/PZvHU on line 16 and defined in /in/PZvHU on line 6 Warning: Missing argument 2 for foo::bar(), called in /in/PZvHU on line 16 and defined in /in/PZvHU on line 6 Notice: Undefined variable: arg1 in /in/PZvHU on line 8 Notice: Undefined variable: arg2 in /in/PZvHU on line 8 -
Output for 5.0.0 - 5.3.29
Fatal error: Function name must be a string in /in/PZvHU on line 16
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Notice: Array to string conversion in /in/PZvHU on line 16 Fatal error: Call to undefined function: array() in /in/PZvHU on line 16
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Notice: Array to string conversion in /in/PZvHU on line 16 Fatal error: Call to undefined function: array() in /in/PZvHU on line 16
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Array to string conversion in /in/PZvHU on line 16 Fatal error: Call to undefined function: array() in /in/PZvHU on line 16