3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = [ 'FoundryMcrouter' => [ 'pool' => [ [ 'host' => 'localhost', 'port' => 11211, 'weight' => 0, ], ], 'namespace' => 'delivery-club', /* 'host' => '', 'cluster' => '/dc/cluster/' */ ], ]; $b = [ 'FoundryMcrouter' => [ 'pool' => [ [ 'host' => 'localhost', 'port' => 11211, 'weight' => 0, ], ], ], ]; var_dump(array_merge_recursive($a,$b));
based on asnLj
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.6
array(1) { ["FoundryMcrouter"]=> array(2) { ["pool"]=> array(2) { [0]=> array(3) { ["host"]=> string(9) "localhost" ["port"]=> int(11211) ["weight"]=> int(0) } [1]=> array(3) { ["host"]=> string(9) "localhost" ["port"]=> int(11211) ["weight"]=> int(0) } } ["namespace"]=> string(13) "delivery-club" } }