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 = count($campaignIds) / $limit; for ($i = 0; $i < $blocksCount; $i++) { print_r((array_slice($campaignIds, $blocksCount * $i, $limit))); }
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 1 [1] => 2 [2] => 3 ) Deprecated: Implicit conversion from float 5.666666666666667 to int loses precision in /in/tutuD on line 7 Array ( [0] => 6 [1] => 7 [2] => 8 ) Deprecated: Implicit conversion from float 11.333333333333334 to int loses precision in /in/tutuD on line 7 Array ( [0] => 12 [1] => 13 [2] => 14 ) Array ( ) Deprecated: Implicit conversion from float 22.666666666666668 to int loses precision in /in/tutuD on line 7 Array ( ) Deprecated: Implicit conversion from float 28.333333333333336 to int loses precision in /in/tutuD on line 7 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:
38.89 ms | 402 KiB | 8 Q