3v4l.org

run code in 300+ PHP versions simultaneously
<?php function restructureArray3($array, $x) { while ($x) $return [] = implode(', ', array_splice($array, 0, ceil(sizeof($array) / $x--))); return $return; } $array = range(1, 100); $x = 3; var_dump(restructureArray3($array, $x));
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> string(125) "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34" [1]=> string(130) "35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67" [2]=> string(131) "68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100" }

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:
60.48 ms | 402 KiB | 8 Q