3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Test\Cases; function exec(\callable $call) {} exec(function() {return true;});
Output for 8.1.23 - 8.1.28, 8.2.10 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught TypeError: Test\Cases\exec(): Argument #1 ($call) must be of type callable, Closure given, called in /in/KU6Wh on line 6 and defined in /in/KU6Wh:4 Stack trace: #0 /in/KU6Wh(6): Test\Cases\exec(Object(Closure)) #1 {main} thrown in /in/KU6Wh on line 4
Process exited with code 255.
Output for 5.4.0 - 5.4.21
Parse error: syntax error, unexpected 'callable' (T_CALLABLE), expecting identifier (T_STRING) in /in/KU6Wh on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Catchable fatal error: Argument 1 passed to Test\Cases\exec() must be an instance of callable, instance of Closure given, called in /in/KU6Wh on line 6 and defined in /in/KU6Wh on line 4
Process exited with code 255.

preferences:
103.72 ms | 401 KiB | 77 Q