3v4l.org

run code in 300+ PHP versions simultaneously
<?php $campaignIds = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17); $limit=3; $blocksCount = floor(count($campaignIds) / $limit);echo $blocksCount.PHP_EOL; for ($i = 0; $i < $blocksCount; $i++) {echo $i.' - '. $blocksCount * $i .PHP_EOL; print_r((array_slice($campaignIds, $blocksCount * $i, $limit))); }
Output for git.master, git.master_jit, rfc.property-hooks
5 0 - 0 Array ( [0] => 1 [1] => 2 [2] => 3 ) 1 - 5 Array ( [0] => 6 [1] => 7 [2] => 8 ) 2 - 10 Array ( [0] => 11 [1] => 12 [2] => 13 ) 3 - 15 Array ( [0] => 16 [1] => 17 ) 4 - 20 Array ( )

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