3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface Foo { public function log($tag, $message); } function f(Foo $x) {} $a = null; f($a);
based on YkVrb
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to f() must implement interface Foo, null given, called in /in/HjE2b on line 11 and defined in /in/HjE2b:7 Stack trace: #0 /in/HjE2b(11): f(NULL) #1 {main} thrown in /in/HjE2b on line 7
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Catchable fatal error: Argument 1 passed to f() must implement interface Foo, null given, called in /in/HjE2b on line 11 and defined in /in/HjE2b on line 7
Process exited with code 255.