3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = function() :string { return 'this is test' . PHP_EOL;}; function foo (callable $c = 'default') { echo $c(); } foo($test);
Output for 8.1.0 - 8.1.26, 8.2.0 - 8.2.13, 8.3.0
Fatal error: Cannot use string as default value for parameter $c of type callable in /in/1S0jn on line 6
Process exited with code 255.

preferences:
154 ms | 996 KiB | 7 Q