3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array1 = ['1' => 'test1','2' => 'test2' ]; $array2 = ['1' => 'test1']; if (is_array($array1) && is_array($array2)){ $array =array_merge($array1, $array2); } var_dump($array); ?>
based on 3O9i6
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
array(3) { [0]=> string(5) "test1" [1]=> string(5) "test2" [2]=> string(5) "test1" }