3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array(array('name' => 'Joe'), array('name' => 'Noe')); var_dump($a); $b = array_fill('0', count($a), array('insert_stamp' => 10)); var_dump(array_replace_recursive($a, $b));
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(2) { [0]=> array(1) { ["name"]=> string(3) "Joe" } [1]=> array(1) { ["name"]=> string(3) "Noe" } } array(2) { [0]=> array(2) { ["name"]=> string(3) "Joe" ["insert_stamp"]=> int(10) } [1]=> array(2) { ["name"]=> string(3) "Noe" ["insert_stamp"]=> int(10) } }
Output for 5.0.0 - 5.2.17
array(2) { [0]=> array(1) { ["name"]=> string(3) "Joe" } [1]=> array(1) { ["name"]=> string(3) "Noe" } } Fatal error: Call to undefined function array_replace_recursive() in /in/L5f1U on line 6
Process exited with code 255.
Output for 4.4.5 - 4.4.9
array(2) { [0]=> array(1) { ["name"]=> string(3) "Joe" } [1]=> array(1) { ["name"]=> string(3) "Noe" } } Fatal error: Call to undefined function: array_replace_recursive() in /in/L5f1U on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.4
array(2) { [0]=> array(1) { ["name"]=> string(3) "Joe" } [1]=> array(1) { ["name"]=> string(3) "Noe" } } Fatal error: Call to undefined function: array_replace_recursive() in /in/L5f1U on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
array(2) { [0]=> array(1) { ["name"]=> string(3) "Joe" } [1]=> array(1) { ["name"]=> string(3) "Noe" } } Fatal error: Call to undefined function: array_replace_recursive() in /in/L5f1U on line 6