3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = ['a' => [1,2,3], 'b' => [4,5,6], 'c' => [7,8,9]]; array_splice($a, 0, 2, ['xxx' => [10,11,12]]); var_dump($a);
based on 5PLpU
Output for 5.4.10 - 7.2.0
array(2) { [0]=> array(3) { [0]=> int(10) [1]=> int(11) [2]=> int(12) } ["c"]=> array(3) { [0]=> int(7) [1]=> int(8) [2]=> int(9) } }
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/6i8f7 on line 3
Process exited with code 255.