3v4l.org

run code in 300+ PHP versions simultaneously
<?php // assumed already rsort()ed. $scores = [92, 84, 84, 84, 83, 65, 41, 38, 38, 37]; $gappedRank = 0; $lookup = []; foreach ($scores as $score) { ++$gappedRank; $lookup[$score] ??= $gappedRank; } var_export($lookup);

preferences:
29.54 ms | 404 KiB | 5 Q