3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = array( array(1,2,3), array(4,5,3), array(7,8,4), array(9,10,4), array(11,12,4) ); $out1 = $out2 = []; $splitIndex = 2; foreach($input as $k => $v){ if($k < $splitIndex){ $out1[] = $v; }else{ $out2[] = $v; } } print_r($out1); print_r($out2);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [0] => 1 [1] => 2 [2] => 3 ) [1] => Array ( [0] => 4 [1] => 5 [2] => 3 ) ) Array ( [0] => Array ( [0] => 7 [1] => 8 [2] => 4 ) [1] => Array ( [0] => 9 [1] => 10 [2] => 4 ) [2] => Array ( [0] => 11 [1] => 12 [2] => 4 ) )

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:
152.82 ms | 407 KiB | 5 Q