3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $questionsets = array( "A" => array("category" => "Some Category A", "score" => 0), "B" => array("category" => "Some Category B", "score" => 29), "C" => array("category" => "Some Category C", "score" => 12), "D" => array("category" => "Some Category D", "score" => 88), "E" => array("category" => "Some Category E", "score" => 4), "F" => array("category" => "Some Category F", "score" => 22), "G" => array("category" => "Some Category G", "score" => 20), "H" => array("category" => "Some Category H", "score" => 40), "I" => array("category" => "Some Category I", "score" => 42) ); usort($questionsets,function($a,$b){return $b['score']-$a['score'];}); print_r($questionsets);
Output for 5.6.0 - 7.3.1
Array ( [0] => Array ( [category] => Some Category D [score] => 88 ) [1] => Array ( [category] => Some Category I [score] => 42 ) [2] => Array ( [category] => Some Category H [score] => 40 ) [3] => Array ( [category] => Some Category B [score] => 29 ) [4] => Array ( [category] => Some Category F [score] => 22 ) [5] => Array ( [category] => Some Category G [score] => 20 ) [6] => Array ( [category] => Some Category C [score] => 12 ) [7] => Array ( [category] => Some Category E [score] => 4 ) [8] => Array ( [category] => Some Category A [score] => 0 ) )