3v4l.org

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