3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array1 = array ( 'nested' => array ( 'orig' => 1, 'numarr' => array( 1, 2, 3, 4, 5 ) ) ); // array2 $array2 = array ( 'nested' => Array ( 'numarr' => Array ( 6, 7 ) ) ); $newArray['nested']['orig'] = $array1['nested']['orig']; $newArray['nested']['numarr'] = $array2['nested']['numarr']; print_r($newArray);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [nested] => Array ( [orig] => 1 [numarr] => Array ( [0] => 6 [1] => 7 ) ) )