3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public function f() { return false; } } $a = new A(); function f(A $a = null) { if ($a->f()) { echo 1; } else { echo 0; } } f(null);
based on NYjPP
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: Call to a member function f() on null in /in/Ahpvq:12 Stack trace: #0 /in/Ahpvq(20): f(NULL) #1 {main} thrown in /in/Ahpvq on line 12
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Fatal error: Call to a member function f() on null in /in/Ahpvq on line 12
Process exited with code 255.
Output for 5.3.19 - 5.5.35
Fatal error: Call to a member function f() on a non-object in /in/Ahpvq on line 12
Process exited with code 255.