3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $base = array('citrus' => array("orange") , 'berries' => array('a' => "blackberry", 'b' => "raspberry"), 'others' => 'banana' ); $replacements = array('citrus' => 'pineapple', 'berries' => array('c' => 'blueberry'), 'others' => array('litchis')); $replacements2 = array('citrus' => array('pineapple'), 'berries' => array('blueberries'), 'others' => 'litchis'); $basket = array_replace_recursive($base, $replacements, $replacements2); print_r($basket);
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [citrus] => Array ( [0] => pineapple ) [berries] => Array ( [a] => blackberry [b] => raspberry [c] => blueberry [0] => blueberries ) [others] => litchis )
Output for 5.0.0 - 5.2.17
Fatal error: Call to undefined function array_replace_recursive() in /in/9BcG8 on line 6
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_replace_recursive() in /in/9BcG8 on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: array_replace_recursive() in /in/9BcG8 on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_replace_recursive() in /in/9BcG8 on line 6