- 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.
<?php
$test = function() :string { return 'this is test' . PHP_EOL;};
function foo (callable $c = 'default') {
echo $c();
}
foo($test);