3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function f() { $foo = null; $foo->foo(); } function f1() { f(); } set_error_handler(function() { var_dump(func_get_args());}, 0xffffffff); register_shutdown_function(function() { var_dump(error_get_last()); }); f1();
based on AWj08
Output for 7.1.0 - 7.3.1
Fatal error: Uncaught Error: Call to a member function foo() on null in /in/IcQdA:5 Stack trace: #0 /in/IcQdA(9): f() #1 /in/IcQdA(14): f1() #2 {main} thrown in /in/IcQdA on line 5 array(4) { ["type"]=> int(1) ["message"]=> string(146) "Uncaught Error: Call to a member function foo() on null in /in/IcQdA:5 Stack trace: #0 /in/IcQdA(9): f() #1 /in/IcQdA(14): f1() #2 {main} thrown" ["file"]=> string(9) "/in/IcQdA" ["line"]=> int(5) }
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function foo() on a non-object (null)' in /in/IcQdA:-1 Stack trace: #0 /in/IcQdA(-1): f() #1 /in/IcQdA(-1): f1() #2 {main} array(4) { ["type"]=> int(0) ["message"]=> string(188) "exception 'BadMethodCallException' with message 'Call to a member function foo() on a non-object (null)' in /in/IcQdA:-1 Stack trace: #0 /in/IcQdA(-1): f() #1 /in/IcQdA(-1): f1() #2 {main}" ["file"]=> string(0) "" ["line"]=> int(0) }
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught exception 'BadMethodCallException' with message 'Call to a member function foo() on a non-object (null)' in /in/IcQdA:5 Stack trace: #0 /in/IcQdA(9): f() #1 /in/IcQdA(14): f1() #2 {main} array(4) { ["type"]=> int(0) ["message"]=> string(186) "exception 'BadMethodCallException' with message 'Call to a member function foo() on a non-object (null)' in /in/IcQdA:5 Stack trace: #0 /in/IcQdA(9): f() #1 /in/IcQdA(14): f1() #2 {main}" ["file"]=> string(0) "" ["line"]=> int(0) }
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Call to a member function foo() on null in /in/IcQdA on line 5 array(4) { ["type"]=> int(1) ["message"]=> string(39) "Call to a member function foo() on null" ["file"]=> string(9) "/in/IcQdA" ["line"]=> int(5) }
Process exited with code 255.