3v4l.org

run code in 300+ PHP versions simultaneously
<?php $values = array(); $values[0] = 5; $values[1] = 12; $values[2] = 19; $values[3] = 9; $ordered_values = $values; rsort($ordered_values); foreach ($values as $key => $value) { foreach ($ordered_values as $ordered_key => $ordered_value) { if ($value === $ordered_value) { $key = $ordered_key; break; } } echo $value . '- Rank: ' . ((int) $key + 1) . '<br/>'; }

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)
8.3.60.0140.00718.55
8.3.50.0100.00522.05
8.3.40.0070.01018.79
8.3.30.0100.00319.21
8.3.20.0040.00420.30
8.3.10.0000.00822.11
8.3.00.0040.00422.43
8.2.180.0090.00916.38
8.2.170.0100.00322.96
8.2.160.0100.00320.88
8.2.150.0030.00624.18
8.2.140.0030.00524.66
8.2.130.0070.00026.16
8.2.120.0080.00019.36
8.2.110.0070.00322.32
8.2.100.0000.01419.64
8.2.90.0040.00419.17
8.2.80.0050.00317.97
8.2.70.0060.00317.63
8.2.60.0080.00017.89
8.2.50.0000.00818.07
8.2.40.0060.00318.28
8.2.30.0000.00718.03
8.2.20.0050.00217.71
8.2.10.0040.00417.63
8.2.00.0000.00717.86
8.1.280.0140.00325.92
8.1.270.0060.00321.89
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0060.00323.76
8.1.230.0110.00018.89
8.1.220.0000.00817.78
8.1.210.0060.00318.77
8.1.200.0090.00017.38
8.1.190.0030.00617.43
8.1.180.0030.00518.79
8.1.170.0040.00418.70
8.1.160.0020.00523.76
8.1.150.0070.00018.68
8.1.140.0040.00417.45
8.1.130.0070.00017.66
8.1.120.0000.00717.48
8.1.110.0000.00817.43
8.1.100.0030.00317.43
8.1.90.0070.00017.43
8.1.80.0000.00817.36
8.1.70.0030.00517.44
8.1.60.0050.00317.61
8.1.50.0040.00417.54
8.1.40.0080.00017.57
8.1.30.0040.00417.61
8.1.20.0050.00317.61
8.1.10.0000.00817.61
8.1.00.0000.00717.43
8.0.300.0040.00418.77
8.0.290.0000.00817.05
8.0.280.0000.00818.43
8.0.270.0070.00017.22
8.0.260.0030.00316.82
8.0.250.0040.00416.99
8.0.240.0000.00716.83
8.0.230.0030.00316.96
8.0.220.0040.00416.98
8.0.210.0030.00316.88
8.0.200.0050.00216.84
8.0.190.0040.00417.00
8.0.180.0080.00316.93
8.0.170.0040.00416.89
8.0.160.0040.00416.91
8.0.150.0000.00716.86
8.0.140.0040.00416.82
8.0.130.0070.00313.36
8.0.120.0040.00416.77
8.0.110.0000.00716.80
8.0.100.0030.00516.77
8.0.90.0030.00616.99
8.0.80.0000.01416.85
8.0.70.0000.00816.79
8.0.60.0000.00716.90
8.0.50.0050.00216.93
8.0.30.0110.00716.99
8.0.20.0120.00717.40
8.0.10.0050.00317.07
8.0.00.0150.01116.89
7.4.330.0060.00015.12
7.4.320.0000.00716.52
7.4.300.0000.00616.51
7.4.290.0030.00316.59
7.4.280.0030.00516.48
7.4.270.0040.00416.52
7.4.260.0070.00016.41
7.4.250.0040.00416.57
7.4.240.0020.00516.49
7.4.230.0030.00316.36
7.4.220.0110.01416.54
7.4.210.0100.00816.58
7.4.200.0070.00016.58
7.4.190.0030.00316.46
7.4.160.0120.00816.38
7.4.150.0120.00617.40
7.4.140.0090.01417.86
7.4.130.0070.01316.44
7.4.120.0050.01216.63
7.4.110.0090.00916.63
7.4.100.0120.00416.45
7.4.90.0090.00916.61
7.4.80.0140.00419.39
7.4.70.0090.00916.48
7.4.60.0030.01616.38
7.4.50.0040.00416.33
7.4.40.0070.01022.77
7.4.30.0120.00416.45
7.4.00.0040.01114.96
7.3.330.0000.00613.07
7.3.320.0050.00013.24
7.3.310.0000.00716.16
7.3.300.0030.00316.32
7.3.290.0070.00716.34
7.3.280.0120.00616.33
7.3.270.0170.00017.40
7.3.260.0130.00316.48
7.3.250.0100.00616.43
7.3.240.0090.00816.63
7.3.230.0030.01316.39
7.3.210.0140.00316.33
7.3.200.0080.01019.39
7.3.190.0120.00916.29
7.3.180.0100.00616.42
7.3.170.0130.01016.31
7.3.160.0060.00916.61
7.3.120.0070.00714.52
7.2.330.0110.00716.42
7.2.320.0130.01016.75
7.2.310.0100.00716.78
7.2.300.0130.00316.71
7.2.290.0160.00316.76
7.2.60.0040.01116.72
7.2.00.0060.00919.56
7.1.200.0080.00415.87
7.1.100.0000.01017.89
7.1.70.0030.00517.21
7.1.60.0140.01019.82
7.1.50.0100.01017.14
7.1.00.0030.07722.48
7.0.200.0030.01016.80
7.0.140.0000.07722.04
7.0.60.0130.04319.93
7.0.50.0070.07017.66
7.0.40.0100.08720.04
7.0.30.0400.07320.13
7.0.20.0400.07020.00
7.0.10.0130.06320.33
7.0.00.0030.04320.00
5.6.280.0000.07721.10
5.6.210.0100.07720.75
5.6.200.0100.08018.19
5.6.190.0070.04320.61
5.6.180.3430.03720.57
5.6.170.0430.05020.44
5.6.160.0030.07320.61
5.6.150.0070.05718.13
5.6.140.0070.05018.16
5.6.130.0100.07718.15
5.6.120.0100.06321.02
5.6.110.0070.09021.09
5.6.100.0070.07721.01
5.6.90.0070.07320.97
5.6.80.0200.07720.36
5.6.70.4270.04020.37
5.5.350.0000.04020.41
5.5.340.0070.03317.98
5.5.330.0100.04020.23
5.5.320.0100.04720.32
5.5.310.0200.03720.12
5.5.300.0000.04318.01
5.5.290.0200.04018.01
5.5.280.0070.05720.97
5.5.270.0130.06320.67
5.5.260.0100.08720.72
5.5.250.0070.07720.68
5.5.240.0100.03720.28
5.4.450.0130.07019.59
5.4.440.0470.05719.32
5.4.430.0030.06019.50
5.4.420.0100.05719.52
5.4.410.0070.05719.31
5.4.400.1070.00018.77
5.4.390.0870.00018.72
5.4.380.0200.06018.63
5.4.370.0970.06018.73
5.4.360.1170.04318.76
5.4.350.1100.05718.41
5.4.340.0800.05018.45
5.4.320.0080.03612.46
5.4.310.0080.03612.45
5.4.300.0080.03612.45
5.4.290.0040.03912.45
5.4.280.0070.03312.35
5.4.270.0050.04712.35
5.4.260.0100.07719.03
5.4.250.0100.05718.77
5.4.240.0030.07718.73
5.4.230.0130.07318.95
5.4.220.0130.06318.93
5.4.210.0070.06718.74
5.4.200.0070.08019.02
5.4.190.0070.05319.02
5.4.180.0100.07319.02
5.4.170.0130.04719.02
5.4.160.0170.06718.66
5.4.150.0070.08018.88
5.4.140.0170.04716.35
5.4.130.0070.06316.18
5.4.120.0030.05716.43
5.4.110.0100.06016.35
5.4.100.0030.07316.26
5.4.90.0200.05716.29
5.4.80.0170.05016.41
5.4.70.0170.04316.33
5.4.60.0130.04316.53
5.4.50.0100.05716.42
5.4.40.0030.05016.28
5.4.30.0100.07016.45
5.4.20.0100.05316.31
5.4.10.0030.05716.30
5.4.00.0100.05015.93
5.3.290.0090.04712.80
5.3.280.0130.05014.64
5.3.270.0130.04714.53
5.3.260.0030.05714.47
5.3.250.0100.05314.62
5.3.240.0030.06014.75
5.3.230.0130.05314.76
5.3.220.0100.07314.44
5.3.210.0100.07014.72
5.3.200.0070.07014.44
5.3.190.0170.06014.59
5.3.180.0170.06314.57
5.3.170.0130.06314.71
5.3.160.0000.06014.40
5.3.150.0000.05714.41
5.3.140.0130.06014.55
5.3.130.0070.07314.54
5.3.120.0000.07014.58
5.3.110.0070.05014.59
5.3.100.0070.06714.18
5.3.90.0030.05713.90
5.3.80.0130.06313.79
5.3.70.0100.05013.96
5.3.60.0170.05714.04
5.3.50.0070.05014.09
5.3.40.0070.05013.95
5.3.30.0070.05313.85
5.3.20.0000.06013.46
5.3.10.0030.06313.42
5.3.00.0100.07013.34
5.2.170.0070.04011.07
5.2.160.0070.04011.23
5.2.150.0100.05711.15
5.2.140.0070.06011.25
5.2.130.0130.05310.94
5.2.120.0130.03310.98
5.2.110.0070.04310.98
5.2.100.0100.05011.01
5.2.90.0070.04711.19
5.2.80.0130.03311.13
5.2.70.0070.05010.93
5.2.60.0100.06010.95
5.2.50.0070.04311.11
5.2.40.0030.05311.14
5.2.30.0030.04710.97
5.2.20.0130.03710.88
5.2.10.0100.05010.93
5.2.00.0000.06310.79
5.1.60.0070.03010.23
5.1.50.0070.0379.82
5.1.40.0030.04710.07
5.1.30.0030.04710.28
5.1.20.0070.03710.33
5.1.10.0030.03710.10
5.1.00.0070.03310.15
5.0.50.0000.0308.60
5.0.40.0070.0378.36
5.0.30.0070.0538.21
5.0.20.0130.0238.38
5.0.10.0070.0238.15
5.0.00.0030.0438.07
4.4.90.0030.0307.43
4.4.80.0070.0207.43
4.4.70.0070.0207.43
4.4.60.0030.0237.43
4.4.50.0070.0277.43
4.4.40.0070.0377.43
4.4.30.0000.0307.43
4.4.20.0100.0177.43
4.4.10.0030.0207.43
4.4.00.0030.0337.43
4.3.110.0000.0337.43
4.3.100.0000.0237.43
4.3.90.0030.0307.43
4.3.80.0070.0407.43
4.3.70.0000.0307.43
4.3.60.0070.0177.43
4.3.50.0000.0237.43
4.3.40.0000.0437.43
4.3.30.0000.0307.43
4.3.20.0000.0237.43
4.3.10.0000.0237.43
4.3.00.0030.0238.20

preferences:
44.41 ms | 401 KiB | 5 Q