3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $testSite = array( 'name' => 'test site', 'modules' => array( 'foo' => 'true', 'bar' => 'true' ) ); $testData = array( 'modules' => array( 'bar' => 'false' ) ); var_dump('before', $testSite); $testSite = array_merge_recursive($testSite, $testData); var_dump('after', $testSite);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(6) "before" array(2) { ["name"]=> string(9) "test site" ["modules"]=> array(2) { ["foo"]=> string(4) "true" ["bar"]=> string(4) "true" } } string(5) "after" array(2) { ["name"]=> string(9) "test site" ["modules"]=> array(2) { ["foo"]=> string(4) "true" ["bar"]=> array(2) { [0]=> string(4) "true" [1]=> string(5) "false" } } }