3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test(int $val) { var_dump($val); } test(null);
Output for 7.3.0alpha1 - 7.3.0rc3
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be of the type int, null given, called in /in/WsZoq on line 6 and defined in /in/WsZoq:3 Stack trace: #0 /in/WsZoq(6): test(NULL) #1 {main} thrown in /in/WsZoq on line 3
Process exited with code 255.
Output for 7.0.0 - 7.2.6
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be of the type integer, null given, called in /in/WsZoq on line 6 and defined in /in/WsZoq:3 Stack trace: #0 /in/WsZoq(6): test(NULL) #1 {main} thrown in /in/WsZoq 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 int, null given in /in/WsZoq:5 Stack trace: #0 /in/WsZoq(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 int, null given, called in /in/WsZoq on line 6 and defined in /in/WsZoq on line 3
Process exited with code 255.