3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function bar(string $foo): string { return $foo; } $result = bar('Hello'); var_dump($result); // Output: string(5) "Hello"
based on rDclU
Output for hhvm-3.18.5 - 3.22.0, 7.1.0 - 7.3.0rc3
string(5) "Hello"
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting '{' in /in/PJOaL on line 3
Process exited with code 255.