3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function what($obj) { return $obj->foo(); } what();
based on MNAsv
Output for 7.1.0 - 7.2.0
Fatal error: Uncaught ArgumentCountError: Too few arguments to function what(), 0 passed in /in/tq6fp on line 7 and exactly 1 expected in /in/tq6fp:3 Stack trace: #0 /in/tq6fp(7): what() #1 {main} thrown in /in/tq6fp on line 3
Process exited with code 255.
Output for 7.0.5 - 7.0.20
Warning: Missing argument 1 for what(), called in /in/tq6fp on line 7 and defined in /in/tq6fp on line 3 Notice: Undefined variable: obj in /in/tq6fp on line 4 Fatal error: Uncaught Error: Call to a member function foo() on null in /in/tq6fp:4 Stack trace: #0 /in/tq6fp(7): what() #1 {main} thrown in /in/tq6fp on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Warning: Missing argument 1 for what(), called in /in/tq6fp on line 7 and defined in /in/tq6fp on line 3 Notice: Undefined variable: obj in /in/tq6fp on line 4 Fatal error: Uncaught Error: Call to a member function foo() on unknown in /in/tq6fp:4 Stack trace: #0 /in/tq6fp(7): what() #1 {main} thrown in /in/tq6fp on line 4
Process exited with code 255.
Output for 5.6.7 - 5.6.28
Warning: Missing argument 1 for what(), called in /in/tq6fp on line 7 and defined in /in/tq6fp on line 3 Notice: Undefined variable: obj in /in/tq6fp on line 4 Fatal error: Call to a member function foo() on null in /in/tq6fp on line 4
Process exited with code 255.
Output for 5.3.19 - 5.5.35
Warning: Missing argument 1 for what(), called in /in/tq6fp on line 7 and defined in /in/tq6fp on line 3 Notice: Undefined variable: obj in /in/tq6fp on line 4 Fatal error: Call to a member function foo() on a non-object in /in/tq6fp on line 4
Process exited with code 255.