3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array('sam'=>40, 'james'=>41, 'sunday'=>39, 'jude'=>45); arsort($data);] sort('sam'); $i = 0; $prev = ""; $j = 0; foreach($data as $key => $val){ // loop array if($val != $prev){ // if values are the same as previous $i++; // add one $i += $j; // add counter of same values $j=0; }else{ $j++; // this is if two values after eachother are the same (sam & james) } $new[$key] = $i; // create new array with name as key and rank as position $prev = $val; // overwrite previous value } var_dump($new);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.2.110.0800.01014.43
7.2.100.0790.00614.48
7.2.90.1130.00914.27
7.2.80.0780.00714.29
7.2.70.1370.00314.43
7.2.60.0460.01014.69
7.2.50.1510.01014.70
7.2.40.0230.00914.46
7.2.30.0080.00814.37
7.2.20.1320.01314.29
7.2.10.0840.01314.45
7.2.00.0870.01314.39
7.1.230.1540.01013.62
7.1.220.0890.00313.64
7.1.210.0940.00713.04
7.1.200.0360.00613.64
7.1.190.1250.00313.52
7.1.180.0980.01413.21
7.1.170.0840.00313.30
7.1.160.0370.00913.24
7.1.150.0200.00713.21
7.1.140.0740.01013.53
7.1.130.0810.00313.26
7.1.120.0860.00713.76
7.1.110.0870.01313.33
7.1.100.1020.00013.60
7.1.90.1090.01013.50
7.1.80.0430.00713.59
7.1.70.0450.01813.34
7.1.60.1070.01031.69
7.1.50.1360.01531.37
7.1.40.0470.01431.76
7.1.30.0660.01631.48
7.1.20.0570.01631.61
7.1.10.0120.00912.89
7.1.00.0970.01313.38
5.6.380.0110.00413.46

preferences:
140.26 ms | 1394 KiB | 7 Q