3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $original = array( '1','2','3','4','5' ); echo "Original array :"."\n"; foreach ($original as $x) {echo "$x ";} $inserted = '$'; array_splice( $original, 3, 0, $inserted ); echo "\n After inserting '$' the array is : \n"; foreach ($original as $x) {echo "$x ";} ?>
Output for 4.3.0 - 7.2.0
Original array : 1 2 3 4 5 After inserting '$' the array is : 1 2 3 $ 4 5