3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test(int $hello = 1) { } test(null);
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be of the type integer, null given, called in /in/VoZIr on line 7 and defined in /in/VoZIr:3 Stack trace: #0 /in/VoZIr(7): test(NULL) #1 {main} thrown in /in/VoZIr on line 3
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Fatal error: Default value for parameters with a class type hint can only be NULL in /in/VoZIr on line 3
Process exited with code 255.