3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(["a" => 1, ...["b" => 2, "c" => 3], "d" => 4]);
Output for 8.1.30 - 8.1.33, 8.2.23 - 8.2.29, 8.3.5 - 8.3.25, 8.4.1 - 8.4.12
array(4) { ["a"]=> int(1) ["b"]=> int(2) ["c"]=> int(3) ["d"]=> int(4) }
Output for 7.4.0 - 7.4.15, 8.0.0 - 8.0.2
Fatal error: Cannot unpack array with string keys in /in/G9MC4 on line 3
Process exited with code 255.
Output for 7.3.0 - 7.3.27
Parse error: syntax error, unexpected '...' (T_ELLIPSIS), expecting ']' in /in/G9MC4 on line 3
Process exited with code 255.

preferences:
67.95 ms | 408 KiB | 5 Q