3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array(1,2,3,4,5,6,7,8); $originalArray = $array1; $array2 = array('a','b','c','d','e','f','g'); $n = count($array1); for($x = 0; $x < $n; $x++) { array_splice($array1, 1, -$x); print_r ($array1); $array1 = $originalArray; }
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 ) Array ( [0] => 1 [1] => 8 ) Array ( [0] => 1 [1] => 7 [2] => 8 ) Array ( [0] => 1 [1] => 6 [2] => 7 [3] => 8 ) Array ( [0] => 1 [1] => 5 [2] => 6 [3] => 7 [4] => 8 ) Array ( [0] => 1 [1] => 4 [2] => 5 [3] => 6 [4] => 7 [5] => 8 ) Array ( [0] => 1 [1] => 3 [2] => 4 [3] => 5 [4] => 6 [5] => 7 [6] => 8 ) Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 )

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.43 ms | 402 KiB | 8 Q