3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function acceptNull(string $a) { var_dump($a); } $b = null; acceptNull($b);
based on vsDWA
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to acceptNull() must be of the type string, null given, called in /in/sq3Lm on line 9 and defined in /in/sq3Lm:3 Stack trace: #0 /in/sq3Lm(9): acceptNull(NULL) #1 {main} thrown in /in/sq3Lm on line 3
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Catchable fatal error: Argument 1 passed to acceptNull() must be an instance of string, null given, called in /in/sq3Lm on line 9 and defined in /in/sq3Lm on line 3
Process exited with code 255.