3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrTags = [ 10 => 2, 20 => 4, 30 => 2, 40 => 3, 50 => 3, 60 => 3, 70 => 3, 80 => 3, 90 => 2, 100 => 1, 110 => 1, 112 => 3, 130 => 2, 140 => 5, 150 => 3 ]; //uksort($arrTags, fn($a, $b) => [$arrTags[$b], $a] <=> [$arrTags[$a], $b]); array_multisort($arrTags, SORT_DESC, array_keys($arrTags), $arrTags); var_export($arrTags);
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
array ( 0 => 5, 1 => 4, 2 => 3, 3 => 3, 4 => 3, 5 => 3, 6 => 3, 7 => 3, 8 => 3, 9 => 2, 10 => 2, 11 => 2, 12 => 2, 13 => 1, 14 => 1, )

preferences:
108.52 ms | 402 KiB | 117 Q