3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function arrayReplace($a1, $a2) { foreach($a2 as $k=>$v) { $a1[$k]=$v; } return $a1; } $a1 = array(0 => 1, 1 => "b", "b" => "carrot"); $a2 = array(1 => "c", 2 => "d", "b" => "apple"); print_r($arrayReplace($a1, $a2));
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: arrayReplace in /in/UnEDY on line 11 Fatal error: Uncaught Error: Function name must be a string in /in/UnEDY:11 Stack trace: #0 {main} thrown in /in/UnEDY on line 11
Process exited with code 255.
Output for 5.0.4 - 5.6.28
Notice: Undefined variable: arrayReplace in /in/UnEDY on line 11 Fatal error: Function name must be a string in /in/UnEDY on line 11
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: arrayReplace in /in/UnEDY on line 11 Fatal error: Function name must be a string in /in/UnEDY on line 11
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Notice: Undefined variable: arrayReplace in /in/UnEDY on line 11 Fatal error: Call to undefined function: () in /in/UnEDY on line 11
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Notice: Undefined variable: arrayReplace in /in/UnEDY on line 11 Fatal error: Call to undefined function: () in /in/UnEDY on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: arrayReplace in /in/UnEDY on line 11 Fatal error: Call to undefined function: () in /in/UnEDY on line 11