3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array( array('f1', 'f2', 'f3'), array('s1', 's2', 's3', 's4', 's5'), array('t1', 't2', 't3', 't4', 't5', 't6', 't7', 't8', 't9', 't10', 't11', 't12') ); $max = 12; $each = $max / count($data); $result = array(); foreach ($data as $set) { $got = 0; while (count($set) > 0 && $got <= $max) { $result[] = array_shift($set); $got++; } } print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => f1 [1] => f2 [2] => f3 [3] => s1 [4] => s2 [5] => s3 [6] => s4 [7] => s5 [8] => t1 [9] => t2 [10] => t3 [11] => t4 [12] => t5 [13] => t6 [14] => t7 [15] => t8 [16] => t9 [17] => t10 [18] => t11 [19] => t12 )

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:
40.97 ms | 401 KiB | 8 Q