3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function a(): string { return null; } var_dump(a());
Output for 7.0.0 - 7.3.0rc3
Fatal error: Uncaught TypeError: Return value of a() must be of the type string, null returned in /in/1DOKM:4 Stack trace: #0 /in/1DOKM(7): a() #1 {main} thrown in /in/1DOKM on line 4
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught TypeError: Value returned from function a() must be of type string, null given in /in/1DOKM:4 Stack trace: #0 /in/1DOKM(7): a() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting '{' in /in/1DOKM on line 3
Process exited with code 255.