3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php namespace Something; function test(Callable $foo) { $foo('ok'); } test('print');
based on 8oCqo
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to Something\test() must be callable, string given, called in /in/hsZ83 on line 8 and defined in /in/hsZ83:4 Stack trace: #0 /in/hsZ83(8): Something\test('print') #1 {main} thrown in /in/hsZ83 on line 4
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Catchable fatal error: Argument 1 passed to Something\test() must be callable, string given, called in /in/hsZ83 on line 8 and defined in /in/hsZ83 on line 4
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Catchable fatal error: Argument 1 passed to Something\test() must be an instance of Something\Callable, string given, called in /in/hsZ83 on line 8 and defined in /in/hsZ83 on line 4
Process exited with code 255.