3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo(callable $arg) : callable { return $arg; } function bar() : callable { return 'hello'; } foo('hello')(); bar('hello')();
based on S4N2c
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be callable, string given, called in /in/83og5 on line 11 and defined in /in/83og5:3 Stack trace: #0 /in/83og5(11): foo('hello') #1 {main} thrown in /in/83og5 on line 3
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Parse error: syntax error, unexpected ':', expecting '{' in /in/83og5 on line 3
Process exited with code 255.