3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function fct_7($name): string { print $name; } fct_7('hello');
based on XSrl1
Output for 7.0.0 - 7.2.0
hello Fatal error: Uncaught TypeError: Return value of fct_7() must be of the type string, none returned in /in/nv1Y8:4 Stack trace: #0 /in/nv1Y8(5): fct_7('hello') #1 {main} thrown in /in/nv1Y8 on line 4
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Parse error: syntax error, unexpected ':', expecting '{' in /in/nv1Y8 on line 2
Process exited with code 255.