3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dataA = array( array( 'type' => 'name', 'key' => 'keywords', 'content' => 'keywordA', ) ); $dataB = array( array( 'type' => 'name', 'key' => 'keywords', 'content' => 'keywordB', ) ); $fd1 = is_callable('array_replace_recursive')?array_replace_recursive($dataA, $dataB):null; $fd2 = $dataB + $dataA; var_dump( $fd1 == $fd2, $fd1, $fd2 );
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
bool(true) array(1) { [0]=> array(3) { ["type"]=> string(4) "name" ["key"]=> string(8) "keywords" ["content"]=> string(8) "keywordB" } } array(1) { [0]=> array(3) { ["type"]=> string(4) "name" ["key"]=> string(8) "keywords" ["content"]=> string(8) "keywordB" } }
Output for 4.3.0 - 5.2.17
bool(false) NULL array(1) { [0]=> array(3) { ["type"]=> string(4) "name" ["key"]=> string(8) "keywords" ["content"]=> string(8) "keywordB" } }