3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test(string $a): string { return round($a, 2); } var_dump(test($a));
Output for 7.0.0 - 7.3.1
Notice: Undefined variable: a in /in/GFk8r on line 5 Fatal error: Uncaught TypeError: Argument 1 passed to test() must be of the type string, null given, called in /in/GFk8r on line 5 and defined in /in/GFk8r:3 Stack trace: #0 /in/GFk8r(5): test(NULL) #1 {main} thrown in /in/GFk8r on line 3
Process exited with code 255.
Output for hhvm-3.15.4
Notice: Undefined variable: a in /in/GFk8r on line 5 Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of string, null given in /in/GFk8r:3 Stack trace: #0 /in/GFk8r(5): test() #1 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting '{' in /in/GFk8r on line 3
Process exited with code 255.