3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data[] = array('volume' => 67, 'edition' => 2); $data[] = array('volume' => 86, 'edition' => 1); $data[] = array('volume' => 85, 'edition' => 6); $data[] = array('volume' => 98, 'edition' => 2); $data[] = array('volume' => 98, 'edition' => 3); $data[] = array('volume' => 98, 'edition' => 1); $data[] = array('volume' => 86, 'edition' => 6); $data[] = array('volume' => 67, 'edition' => 7); foreach ($data as $key => $row) { $volume[$key] = $row['volume']; $edition[$key] = $row['edition']; } print_r($volume); // Sort the data with volume descending, edition ascending // Add $data as the last parameter, to sort by the common key array_multisort($volume, SORT_DESC, $edition, SORT_ASC, $data); print_r($data);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => 67 [1] => 86 [2] => 85 [3] => 98 [4] => 98 [5] => 98 [6] => 86 [7] => 67 ) Array ( [0] => Array ( [volume] => 98 [edition] => 1 ) [1] => Array ( [volume] => 98 [edition] => 2 ) [2] => Array ( [volume] => 98 [edition] => 3 ) [3] => Array ( [volume] => 86 [edition] => 1 ) [4] => Array ( [volume] => 86 [edition] => 6 ) [5] => Array ( [volume] => 85 [edition] => 6 ) [6] => Array ( [volume] => 67 [edition] => 2 ) [7] => Array ( [volume] => 67 [edition] => 7 ) )

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