3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array1 = array("orange", "apple", "grape"); $array2 = array("peach", "orange", "plumb"); $array3 = array("lemon", 342); $newArray = array_merge($array1, $array2, $array3); foreach ($newArray as $key => $value) { echo "$key - <strong>$value</strong> <br />"; } ?>
Output for 4.3.0 - 7.1.0
0 - <strong>orange</strong> <br />1 - <strong>apple</strong> <br />2 - <strong>grape</strong> <br />3 - <strong>peach</strong> <br />4 - <strong>orange</strong> <br />5 - <strong>plumb</strong> <br />6 - <strong>lemon</strong> <br />7 - <strong>342</strong> <br />