3v4l.org

run code in 300+ PHP versions simultaneously
<?php $max = 13; // The last number $cols = 4; // The point at which a new line will start $arr = array_chunk(range(1, $max), $cols); // Magic ;D // Print the data. foreach ($arr as $key => $row) { // In case we are wrapping on the far side, this will prevent the row from // starting on the left. $row = array_pad($row, $cols, ' '); // This will reverse every other row $row = ($key % 2 === 0) ? $row : array_reverse($row); foreach ($row as $value) { $value = str_pad($value, strlen($max), ' ', STR_PAD_LEFT); echo "{$value} "; } echo "\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
1 2 3 4 8 7 6 5 9 10 11 12 13

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:
119.77 ms | 405 KiB | 5 Q