3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array('A' => 1, 'B' => 2, 'C' => 3); $b = array('B' => 6, 'D' => 7, 'E' => 8); $c = array_merge($a, $b); var_dump($a); var_dump($b); var_dump($c);
based on vfKtE
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(3) { ["A"]=> int(1) ["B"]=> int(2) ["C"]=> int(3) } array(3) { ["B"]=> int(6) ["D"]=> int(7) ["E"]=> int(8) } array(5) { ["A"]=> int(1) ["B"]=> int(6) ["C"]=> int(3) ["D"]=> int(7) ["E"]=> int(8) }