3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array('a' => 'A', 'b' => 'B', 'c' => 'C'); $b = array('a' => 'AA', 'd' => 'DD'); var_dump($a + $b); var_dump(array_merge($a, $b));
Output for 4.3.0 - 7.2.0
array(4) { ["a"]=> string(1) "A" ["b"]=> string(1) "B" ["c"]=> string(1) "C" ["d"]=> string(2) "DD" } array(4) { ["a"]=> string(2) "AA" ["b"]=> string(1) "B" ["c"]=> string(1) "C" ["d"]=> string(2) "DD" }