3v4l.org

run code in 300+ PHP versions simultaneously
<?php $el = [1, 2,3,4,5,23,23,323,23,3,24,42,3,43,423]; var_dump(array_splice($el, 0, 5)); var_dump(array_splice($el, 0, 5)); var_dump(array_splice($el, 1, 3)); $el = ['a'=>1, 'b'=>2, 1=>3,0=>4,5=>5]; var_dump(array_splice($el, 0, 3)); var_dump(array_splice($el, 0, 3)); var_dump(array_splice($el, 1, 3));
Output for git.master, git.master_jit
array(5) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) } array(5) { [0]=> int(23) [1]=> int(23) [2]=> int(323) [3]=> int(23) [4]=> int(3) } array(3) { [0]=> int(42) [1]=> int(3) [2]=> int(43) } array(3) { ["a"]=> int(1) ["b"]=> int(2) [0]=> int(3) } array(2) { [0]=> int(4) [1]=> int(5) } array(0) { }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
58.5 ms | 406 KiB | 5 Q