3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $original = array( array('a'=>'a'),array('b'=>'b'),array('c'=>'c')); $inserted = array( array('d'=>'d') ); array_splice( $original, 2, 0, $inserted ); var_dump($original);
based on lLp7u
Output for 4.3.0 - 7.1.0
array(4) { [0]=> array(1) { ["a"]=> string(1) "a" } [1]=> array(1) { ["b"]=> string(1) "b" } [2]=> array(1) { ["d"]=> string(1) "d" } [3]=> array(1) { ["c"]=> string(1) "c" } }