- Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.15
- Warning: Unsupported declare 'strict_types' in /in/5mKNF on line 3
Fatal error: Default value for parameters with a class type hint can only be NULL in /in/5mKNF on line 5
Process exited with code 255.
<?php
declare(strict_types=1);
function concat(string $separator = ' ', string ...$strings): string {
return implode($separator, $strings);
}
echo concat(':', 'One', 'Two', 'Three') . "\n";
echo concat(default, '1', '2', '3');