3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = array("a" => "red", "b" => "green"); $y = array("c" => "blue", "d" => "yellow"); $c = array(5, 6, 7, 8); $d = array(9, 10, 11, 12); print_r(array_merge($x, $y, $d, $c)); // union of $x and $y ?>
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.6 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
Array ( [a] => red [b] => green [c] => blue [d] => yellow [0] => 9 [1] => 10 [2] => 11 [3] => 12 [4] => 5 [5] => 6 [6] => 7 [7] => 8 )

preferences:
83.34 ms | 408 KiB | 5 Q