3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { } function bar(Foo $foo) { } bar(null);
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to bar() must be an instance of Foo, null given, called in /in/2hOek on line 9 and defined in /in/2hOek:5 Stack trace: #0 /in/2hOek(9): bar(NULL) #1 {main} thrown in /in/2hOek on line 5
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Catchable fatal error: Argument 1 passed to bar() must be an instance of Foo, null given, called in /in/2hOek on line 9 and defined in /in/2hOek on line 5
Process exited with code 255.