3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ ['price'=>100, 'rank'=>3], ['price'=>55000, 'rank'=>4], ['price'=>500, 'rank'=>5], ['price'=>130, 'rank'=>3], ['price'=>25000, 'rank'=>4], ['price'=>50000, 'rank'=>4], ['price'=>120, 'rank'=>3], ['price'=>1000, 'rank'=>5], ]; $price = array_column($arr, 'price'); $rank = array_column($arr, 'rank'); // Sort the data with price descending, rank descending // Add $data as the last parameter, to sort by the common key array_multisort($rank, SORT_DESC, $price, SORT_DESC, $arr); echo '<pre>'; print_r($arr); die;
Output for git.master, git.master_jit, rfc.property-hooks
<pre>Array ( [0] => Array ( [price] => 1000 [rank] => 5 ) [1] => Array ( [price] => 500 [rank] => 5 ) [2] => Array ( [price] => 55000 [rank] => 4 ) [3] => Array ( [price] => 50000 [rank] => 4 ) [4] => Array ( [price] => 25000 [rank] => 4 ) [5] => Array ( [price] => 130 [rank] => 3 ) [6] => Array ( [price] => 120 [rank] => 3 ) [7] => Array ( [price] => 100 [rank] => 3 ) )

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:
148.81 ms | 407 KiB | 5 Q