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' => 86, 'edition' => 6); $data[] = array('volume' => 67, 'edition' => 7); // Obtain a list of columns foreach ($data as $key => $row) { $volume[$key] = $row['volume']; $edition[$key] = $row['edition']; } // 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); var_dump($data);
Output for git.master, git.master_jit, rfc.property-hooks
array(6) { [0]=> array(2) { ["volume"]=> int(67) ["edition"]=> int(2) } [1]=> array(2) { ["volume"]=> int(86) ["edition"]=> int(1) } [2]=> array(2) { ["volume"]=> int(85) ["edition"]=> int(6) } [3]=> array(2) { ["volume"]=> int(98) ["edition"]=> int(2) } [4]=> array(2) { ["volume"]=> int(86) ["edition"]=> int(6) } [5]=> array(2) { ["volume"]=> int(67) ["edition"]=> int(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:
49.58 ms | 402 KiB | 8 Q