3v4l.org

run code in 200+ 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 - 7.1.7
array(5) { ["a"]=> string(3) "foo" ["b"]=> string(0) "" ["c"]=> string(0) "" ["d"]=> string(3) "foo" ["e"]=> string(0) "" }