3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $tmp = array( 'q1' => 'qwqwqw', 'w2' => 'www', 'r3'=> 'eee', 'u8'=>'333e', ); $tmp = array_merge(array_slice($tmp,0,2, false), array('third' => 'ddddddddd'),array_slice($tmp,2)); var_dump($tmp);
based on DsX67
Output for 5.6.0 - 5.6.30, hhvm-3.12.14 - 3.17.3, 7.0.0 - 7.3.0rc3
array(5) { ["q1"]=> string(6) "qwqwqw" ["w2"]=> string(3) "www" ["third"]=> string(9) "ddddddddd" ["r3"]=> string(3) "eee" ["u8"]=> string(4) "333e" }