3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test(string $val) { var_dump($val); } test(null);
based on WsZoq
Output for 7.0.0 - 7.2.6
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be of the type string, null given, called in /in/O0qgM on line 6 and defined in /in/O0qgM:3 Stack trace: #0 /in/O0qgM(6): test(NULL) #1 {main} thrown in /in/O0qgM on line 3
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of string, null given in /in/O0qgM:5 Stack trace: #0 /in/O0qgM(6): test() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Catchable fatal error: Argument 1 passed to test() must be an instance of string, null given, called in /in/O0qgM on line 6 and defined in /in/O0qgM on line 3
Process exited with code 255.