3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class T { } function fn(T $t) { } fn(null);
Output for 7.0.0 - 7.3.0beta1
Fatal error: Uncaught TypeError: Argument 1 passed to fn() must be an instance of T, null given, called in /in/pXgKB on line 11 and defined in /in/pXgKB:7 Stack trace: #0 /in/pXgKB(11): fn(NULL) #1 {main} thrown in /in/pXgKB on line 7
Process exited with code 255.
Output for hhvm-3.12.14 - 3.17.3
Fatal error: Uncaught TypeError: Argument 1 passed to fn() must be an instance of T, null given in /in/pXgKB:9 Stack trace: #0 /in/pXgKB(11): fn() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Catchable fatal error: Argument 1 passed to fn() must be an instance of T, null given, called in /in/pXgKB on line 11 and defined in /in/pXgKB on line 7
Process exited with code 255.