3v4l.org

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