3v4l.org

run code in 300+ PHP versions simultaneously
<?php $b = [1,2,3]; $c = [4,5,6]; $a = [...$b, ...$c]; var_dump($a);
Output for 7.4.0 - 7.4.23, 8.0.0 - 8.0.10, 8.1rc1
array(6) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) [5]=> int(6) }
Output for 7.3.0 - 7.3.30
Parse error: syntax error, unexpected '...' (T_ELLIPSIS), expecting ']' in /in/ZZS7A on line 5
Process exited with code 255.

preferences:
19.33 ms | 460 KiB | 5 Q