3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( array('value' => 1), array('value' => 2), array('value' => 2), //Move this array('value' => 2), //Move the also second duplicate array('value' => 'A'), array('value' => 'B'), array('value' => 'C'), array('value' => 6), array('value' => 7), array('value' => 7), //Move this array('value' => 8), array('value' => 9), array('value' => 10), array('value' => 11) ); usort($array, function($a, $b){ return strcmp($a['value'], $b['value']);}); $chunks = array_chunk($array, ceil(count($array)/5)); $array = array(); for($x = 0, $numX = count($chunks[0]); $x < $numX; $x++){ for($y = 0, $numY = count($chunks); $y < $numY; $y++){ $array[] = $chunks[$y][$x]; } } print_r($array);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined array key 2 in /in/BtYMG on line 27 Array ( [0] => Array ( [value] => 1 ) [1] => Array ( [value] => 2 ) [2] => Array ( [value] => 6 ) [3] => Array ( [value] => 8 ) [4] => Array ( [value] => B ) [5] => Array ( [value] => 10 ) [6] => Array ( [value] => 2 ) [7] => Array ( [value] => 7 ) [8] => Array ( [value] => 9 ) [9] => Array ( [value] => C ) [10] => Array ( [value] => 11 ) [11] => Array ( [value] => 2 ) [12] => Array ( [value] => 7 ) [13] => Array ( [value] => A ) [14] => )

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:
41.67 ms | 403 KiB | 8 Q