3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ['a1','a2','a3','a4']; $b = ['b1','b2','b3','b4']; $c = ['c1','c2','c3','c4']; $all = [ $a, $b, $c ]; $result = []; for( $i=0; $i<count( $a ); $i++ ) { for( $j=0; $j<count( $all ); $j++ ) { $result[] = $all[ 3*(($i+$j*2)%3>0)-(($i+$j*2)%3) ][ $i ]; } } print_r($result);
Output for git.master_jit, git.master, rfc.property-hooks
Array ( [0] => a1 [1] => b1 [2] => c1 [3] => c2 [4] => a2 [5] => b2 [6] => b3 [7] => c3 [8] => a3 [9] => a4 [10] => b4 [11] => c4 )

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:
27.01 ms | 406 KiB | 5 Q