3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?hh function foo(): (function(string): string) { $x = 'bar'; return $y ==> $x . $y; } function test(): void { $fn = foo(); echo $fn('baz'); // barbaz }
based on 2DhaM
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.0.13
Parse error: syntax error, unexpected 'function' (T_FUNCTION) in /in/DHgcQ on line 2
Process exited with code 255.
Output for hhvm-3.10.0 - 3.13.2