3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public function b(A $a) { var_dump($a); } } $x = new A(); $y = null; $x->b($y);
Output for 7.0.0 - 7.3.0beta1
Fatal error: Uncaught TypeError: Argument 1 passed to A::b() must be an instance of A, null given, called in /in/v54Ze on line 11 and defined in /in/v54Ze:4 Stack trace: #0 /in/v54Ze(11): A->b(NULL) #1 {main} thrown in /in/v54Ze on line 4
Process exited with code 255.
Output for hhvm-3.22.0
Fatal error: Uncaught TypeError: Argument 1 passed to A::b() must be an instance of A, null given in /in/v54Ze:-1 Stack trace: #0 /in/v54Ze(-1): A->b() #1 {main}
Process exited with code 255.
Output for hhvm-3.18.5 - 3.21.3
Fatal error: Uncaught TypeError: Argument 1 passed to A::b() must be an instance of A, null given in /in/v54Ze:6 Stack trace: #0 /in/v54Ze(11): A->b() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Catchable fatal error: Argument 1 passed to A::b() must be an instance of A, null given, called in /in/v54Ze on line 11 and defined in /in/v54Ze on line 4
Process exited with code 255.