3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function henk(string $hans): string { var_dump($hans); } henk(null); henk("ben ik");
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to henk() must be of the type string, null given, called in /in/N447V on line 8 and defined in /in/N447V:3 Stack trace: #0 /in/N447V(8): henk(NULL) #1 {main} thrown in /in/N447V on line 3
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Parse error: syntax error, unexpected ':', expecting '{' in /in/N447V on line 3
Process exited with code 255.