3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $foo = array('a' => '', 'b' => '', 'c' => '', 'd' => '', 'e' => '', ); $bar = array('a' => 'foo', 'd' => 'foo', ); $merged = array_merge($foo, $bar); var_dump($merged);
based on m9V87
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(5) { ["a"]=> string(3) "foo" ["b"]=> string(0) "" ["c"]=> string(0) "" ["d"]=> string(3) "foo" ["e"]=> string(0) "" }