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);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 92 => 1, 84 => 2, 83 => 5, 65 => 6, 41 => 7, 38 => 8, 37 => 10, )

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:
26.5 ms | 405 KiB | 5 Q