3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); function concat(string $separator = ' ', string ...$strings): string { return implode($separator, $strings); } echo concat(':', 'One', 'Two', 'Three') . "\n"; echo concat(null, '1', '2', '3');
based on 5mKNF
Output for 7.0.0 - 7.2.0
One:Two:Three Fatal error: Uncaught TypeError: Argument 1 passed to concat() must be of the type string, null given, called in /in/U9Dfj on line 10 and defined in /in/U9Dfj:5 Stack trace: #0 /in/U9Dfj(10): concat(NULL, '1', '2', '3') #1 {main} thrown in /in/U9Dfj on line 5
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/U9Dfj on line 3 Fatal error: Default value for parameters with a class type hint can only be NULL in /in/U9Dfj on line 5
Process exited with code 255.