3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function derp(int $derp = 1){ echo $derp; } derp(null);
Output for 7.3.0alpha1 - 7.3.0rc3
Fatal error: Uncaught TypeError: Argument 1 passed to derp() must be of the type int, null given, called in /in/CF4Pl on line 7 and defined in /in/CF4Pl:3 Stack trace: #0 /in/CF4Pl(7): derp(NULL) #1 {main} thrown in /in/CF4Pl on line 3
Process exited with code 255.
Output for 7.0.0 - 7.2.6
Fatal error: Uncaught TypeError: Argument 1 passed to derp() must be of the type integer, null given, called in /in/CF4Pl on line 7 and defined in /in/CF4Pl:3 Stack trace: #0 /in/CF4Pl(7): derp(NULL) #1 {main} thrown in /in/CF4Pl on line 3
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught TypeError: Argument 1 passed to derp() must be an instance of int, null given in /in/CF4Pl:5 Stack trace: #0 /in/CF4Pl(7): derp() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Fatal error: Default value for parameters with a class type hint can only be NULL in /in/CF4Pl on line 3
Process exited with code 255.