3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $defaults = array( 'lang' => 'de', 'be' => 11, 'ce' => 16 ); $given = array( 'lang' => '', 'be' => 12, 'asas'=> 'basas' ); $a = array_merge($given, $defaults); $b = array_merge($defaults, $a); print_r($b);
based on 7FEnC
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0alpha1
Array ( [lang] => de [be] => 11 [ce] => 16 [asas] => basas )