3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL | E_STRICT); ini_set('display_errors', 1); // your original input $original = array(12, 17, 5, 27, 5); // strip duplicates as they are ranked equally $rankings = array_unique($original); // apply some sorting so that the ranks are now given by the keys. rsort($rankings); // now just use the origincal array and lookup the rankings for each value $return = array(); foreach($original as $value) { $rankedValue = array(); $rankedValue['value'] = $value; $rankedValue['rank'] = array_search($value, $rankings) + 1; $return[] = $rankedValue; } var_dump($return);

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.40.0040.01118.67
8.3.30.0140.00019.09
8.3.20.0050.00320.20
8.3.10.0040.00421.86
8.3.00.0040.00419.18
8.2.170.0140.00422.96
8.2.160.0070.00722.25
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0000.00726.16
8.2.120.0040.00419.79
8.2.110.0040.00419.45
8.2.100.0040.00817.91
8.2.90.0030.00519.36
8.2.80.0040.00417.97
8.2.70.0030.00617.50
8.2.60.0000.00818.05
8.2.50.0050.00518.07
8.2.40.0030.00518.22
8.2.30.0000.00719.21
8.2.20.0040.00417.75
8.2.10.0040.00418.03
8.2.00.0000.00717.62
8.1.270.0050.00319.00
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00720.97
8.1.230.0110.00017.45
8.1.220.0040.00417.79
8.1.210.0000.00818.77
8.1.200.0100.00017.22
8.1.190.0040.00417.00
8.1.180.0040.00418.10
8.1.170.0000.00818.37
8.1.160.0040.00422.02
8.1.150.0030.00518.76
8.1.140.0040.00419.21
8.1.130.0030.00317.88
8.1.120.0040.00417.46
8.1.110.0070.00017.45
8.1.100.0000.00717.36
8.1.90.0000.00717.40
8.1.80.0070.00017.46
8.1.70.0030.00317.47
8.1.60.0000.00817.54
8.1.50.0040.00417.54
8.1.40.0060.00317.36
8.1.30.0060.00317.55
8.1.20.0040.00417.59
8.1.10.0040.00417.48
8.1.00.0040.00417.56
8.0.300.0040.00418.77
8.0.290.0080.00016.63
8.0.280.0070.00018.36
8.0.270.0070.00017.20
8.0.260.0030.00317.22
8.0.250.0070.00016.89
8.0.240.0030.00316.84
8.0.230.0000.00716.81
8.0.220.0030.00316.80
8.0.210.0000.00716.90
8.0.200.0000.00616.92
8.0.190.0000.00816.83
8.0.180.0070.00016.80
8.0.170.0040.00416.93
8.0.160.0000.00716.97
8.0.150.0000.00716.93
8.0.140.0070.00016.83
8.0.130.0060.00013.28
8.0.120.0030.00516.96
8.0.110.0040.00416.84
8.0.100.0000.00916.79
8.0.90.0030.00616.91
8.0.80.0100.00916.88
8.0.70.0040.00416.78
8.0.60.0040.00417.01
8.0.50.0000.00716.98
8.0.30.0090.01017.08
8.0.20.0160.00617.40
8.0.10.0000.00716.95
8.0.00.0110.01116.74
7.4.330.0020.00215.15
7.4.320.0030.00316.65
7.4.300.0030.00316.59
7.4.290.0030.00316.52
7.4.280.0040.00716.61
7.4.270.0030.00316.52
7.4.260.0000.00716.38
7.4.250.0040.00416.57
7.4.240.0000.00716.48
7.4.230.0030.00316.39
7.4.220.0090.01016.45
7.4.210.0100.00616.69
7.4.200.0000.00716.30
7.4.160.0110.00416.36
7.4.150.0140.01117.40
7.4.140.0080.01117.86
7.4.130.0090.00916.67
7.4.120.0100.01016.59
7.4.110.0100.01016.35
7.4.100.0140.01016.46
7.4.90.0090.00916.57
7.4.80.0080.01119.39
7.4.70.0140.00716.70
7.4.60.0060.01316.64
7.4.50.0060.00316.25
7.4.40.0060.01216.71
7.4.30.0090.01416.62
7.4.10.0070.01115.13
7.4.00.0080.00914.83
7.3.330.0030.00313.24
7.3.320.0000.00513.10
7.3.310.0000.00716.30
7.3.300.0000.00616.32
7.3.290.0110.00616.33
7.3.280.0090.00816.30
7.3.270.0110.01217.40
7.3.260.0060.01316.29
7.3.250.0100.01216.55
7.3.240.0100.00616.54
7.3.230.0080.01516.39
7.3.210.0130.00616.50
7.3.200.0160.00619.39
7.3.190.0120.00616.50
7.3.180.0110.00516.61
7.3.170.0060.01216.61
7.3.160.0070.01016.39
7.3.130.0060.01014.82
7.3.120.0110.00714.81
7.3.110.0130.00614.84
7.3.100.0000.01415.14
7.3.90.0070.00715.08
7.3.80.0040.01114.87
7.3.70.0030.00614.59
7.3.60.0030.00714.61
7.3.50.0070.00714.85
7.3.40.0000.00914.82
7.3.30.0000.01214.76
7.3.20.0030.00616.55
7.3.10.0000.01516.63
7.3.00.0030.01016.54
7.2.330.0080.01116.66
7.2.320.0110.00816.41
7.2.310.0130.01016.60
7.2.300.0030.01316.72
7.2.290.0060.01616.58
7.2.260.0140.00315.06
7.2.250.0060.00914.73
7.2.240.0140.00315.32
7.2.230.0070.00715.19
7.2.220.0090.00614.73
7.2.210.0070.01015.34
7.2.200.0070.00314.88
7.2.190.0040.01114.95
7.2.180.0070.00715.07
7.2.170.0080.00414.98
7.2.160.0000.01315.10
7.2.150.0000.01816.72
7.2.140.0090.00016.80
7.2.130.0000.01416.93
7.2.120.0030.00916.88
7.2.110.0040.00816.91
7.2.100.0070.00716.96
7.2.90.0000.01317.06
7.2.80.0090.00317.07
7.2.70.0040.01117.02
7.2.60.0030.01216.91
7.2.50.0060.00616.84
7.2.40.0040.01516.80
7.2.30.0060.00616.68
7.2.20.0080.00816.93
7.2.10.0000.01516.75
7.2.00.0050.00818.32
7.1.330.0040.01115.84
7.1.320.0070.00716.04
7.1.310.0090.00615.82
7.1.300.0100.00315.59
7.1.290.0060.00915.66
7.1.280.0050.00315.91
7.1.270.0030.00915.87
7.1.260.0000.01215.75
7.1.250.0100.00315.69
7.1.240.0040.00415.90
7.1.230.0030.00615.95
7.1.220.0110.00316.02
7.1.210.0050.00315.51
7.1.200.0100.00415.63
7.1.190.0060.00615.93
7.1.180.0030.01015.76
7.1.170.0040.00915.63
7.1.160.0040.00815.87
7.1.150.0030.00615.63
7.1.140.0030.01015.82
7.1.130.0000.01615.83
7.1.120.0060.00615.79
7.1.110.0080.00415.69
7.1.100.0050.00917.09
7.1.90.0030.00815.64
7.1.80.0000.01015.87
7.1.70.0000.01116.32
7.1.60.0160.00417.56
7.1.50.0100.00316.38
7.1.40.0070.00715.73
7.1.30.0070.00715.80
7.1.20.0060.00615.47
7.1.10.0080.00615.92
7.1.00.0070.04019.17
7.0.330.0110.00315.57
7.0.320.0040.00415.49
7.0.310.0060.00615.14
7.0.300.0060.00915.40
7.0.290.0080.00415.46
7.0.280.0060.00615.39
7.0.270.0040.00715.53
7.0.260.0030.00715.44
7.0.250.0000.01415.68
7.0.240.0090.00615.33
7.0.230.0090.00315.45
7.0.220.0090.00615.53
7.0.210.0040.00815.50
7.0.200.0070.00715.20
7.0.190.0080.00615.48
7.0.180.0040.00815.10
7.0.170.0030.00915.45
7.0.160.0040.00715.18
7.0.150.0090.00615.48
7.0.140.0050.02018.75
7.0.130.0060.00615.39
7.0.120.0130.00015.29
7.0.110.0000.00815.20
7.0.100.0040.00415.48
7.0.90.0070.00415.54
7.0.80.0040.00815.54
7.0.70.0060.00615.48
7.0.60.0080.03817.63
7.0.50.0080.02216.69
7.0.40.0070.02816.88
7.0.30.0150.03516.91
7.0.20.0200.02716.85
7.0.10.0020.02716.80
7.0.00.0130.03816.74
5.6.400.0110.00414.23
5.6.390.0000.01014.63
5.6.380.0030.00714.11
5.6.370.0030.00914.65
5.6.360.0040.01114.49
5.6.350.0070.00714.79
5.6.340.0030.01014.46
5.6.330.0030.01014.70
5.6.320.0030.01014.47
5.6.310.0030.01114.69
5.6.300.0090.00614.58
5.6.290.0090.00914.32
5.6.280.0070.03717.85
5.6.270.0030.01114.56
5.6.260.0000.01614.21
5.6.250.0070.00714.56
5.6.240.0030.00714.43
5.6.230.0000.01014.54
5.6.220.0120.00314.51
5.6.210.0050.05017.42
5.6.200.0070.02216.19
5.6.190.0050.04817.59
5.6.180.0180.03517.53
5.6.170.0180.04017.46
5.6.160.0050.02817.32
5.6.150.0100.03816.18
5.6.140.0100.04316.11
5.6.130.0080.03316.13
5.6.120.0080.04517.63
5.6.110.0120.04017.82
5.6.100.0030.04817.65
5.6.90.0040.03617.63
5.6.80.0090.04217.52
5.6.70.0120.00314.41
5.6.60.0000.01414.11
5.6.50.0070.00714.30
5.6.40.0040.00414.29
5.6.30.0070.00714.45
5.6.20.0030.00614.41
5.6.10.0060.00614.55
5.6.00.0080.00614.39
5.5.350.0230.05320.40
5.5.340.0070.03717.98
5.5.330.0070.04720.25
5.5.320.0070.06020.17
5.5.310.0300.05020.30
5.5.300.0030.07717.92
5.5.290.0070.04717.89
5.5.280.0030.04320.76
5.5.270.0000.04320.96
5.5.260.0100.05020.85
5.5.250.0030.05020.71
5.5.240.0030.06020.06
5.4.450.0100.07719.40
5.4.440.0070.06719.41
5.4.430.0000.05019.47
5.4.420.0000.04719.12
5.4.410.0030.03719.25
5.4.400.0000.05019.14
5.4.390.0000.04719.08
5.4.380.0030.04719.23
5.4.370.0100.06318.93
5.4.360.0000.05019.08
5.4.350.0000.04018.78
5.4.340.0100.07019.13
5.4.320.0070.07719.08
5.4.310.0000.05019.09
5.4.300.0000.04718.80
5.4.290.0070.05018.80
5.4.280.0000.04019.12
5.4.270.0030.04019.08
5.4.260.0000.07719.13
5.4.250.0000.03718.80
5.4.240.0000.05319.15
5.4.230.0000.07719.09
5.4.220.0000.04719.12
5.4.210.0000.04319.23
5.4.200.0030.07018.95
5.4.190.0070.04019.20
5.4.180.0000.04319.06
5.4.170.0030.04718.91
5.4.160.0000.06018.89
5.4.150.0070.03318.76
5.4.140.0000.03716.54
5.4.130.0000.03716.27
5.4.120.0030.04716.36
5.4.110.0030.07016.49
5.4.100.0030.07016.43
5.4.90.0070.06316.43
5.4.80.0070.07316.37
5.4.70.0070.06716.37
5.4.60.0130.06016.41
5.4.50.0030.06316.27
5.4.40.0000.07016.44
5.4.30.0030.07316.35
5.4.20.0030.04316.30
5.4.10.0030.08016.36
5.4.00.0070.05715.79
5.3.290.0000.05714.47
5.3.280.0000.04014.59
5.3.270.0030.07314.45
5.3.260.0000.04014.45
5.3.250.0030.04014.44
5.3.240.0000.03714.51
5.3.230.0000.06714.45
5.3.220.0000.05314.42
5.3.210.0030.07314.47
5.3.200.0030.07314.59
5.3.190.0070.05314.40
5.3.180.0000.08014.39
5.3.170.0200.03714.51
5.3.160.0030.05314.40
5.3.150.0030.07014.59
5.3.140.0070.07014.50
5.3.130.0030.04314.41
5.3.120.0030.06714.42
5.3.110.0030.05714.49
5.3.100.0030.05713.98
5.3.90.0000.04313.85
5.3.80.0000.07314.00
5.3.70.0100.06313.79
5.3.60.0000.07313.95
5.3.50.0000.07713.93
5.3.40.0000.04713.88
5.3.30.0030.07013.75
5.3.20.0000.03313.52
5.3.10.0030.03713.56
5.3.00.0000.03713.44
5.2.170.0030.06010.99
5.2.160.0030.06011.19
5.2.150.0030.03311.00
5.2.140.0000.03311.19
5.2.130.0000.02710.96
5.2.120.0000.03310.94
5.2.110.0000.03010.95
5.2.100.0000.06010.96
5.2.90.0000.06011.25
5.2.80.0070.05010.95
5.2.70.0030.06010.94
5.2.60.0000.03010.95
5.2.50.0000.05010.87
5.2.40.0000.03310.83
5.2.30.0000.03010.82
5.2.20.0030.04710.86
5.2.10.0000.03711.07
5.2.00.0000.03310.63
5.1.60.0030.05310.41
5.1.50.0070.02710.42
5.1.40.0000.03010.44
5.1.30.0030.03010.44
5.1.20.0000.04310.47
5.1.10.0000.03310.47
5.1.00.0030.03010.47
5.0.50.0000.03310.50
5.0.40.0000.04710.50
5.0.30.0070.03710.52
5.0.20.0000.04310.54
5.0.10.0000.05010.54
5.0.00.0030.05310.54
4.4.90.0030.01310.41
4.4.80.0030.01710.41
4.4.70.0030.01310.41
4.4.60.0030.01310.41
4.4.50.0000.01710.41
4.4.40.0000.04010.41
4.4.30.0030.02710.43
4.4.20.0030.02310.47
4.4.10.0000.01710.49
4.4.00.0000.03310.50
4.3.110.0000.02010.51
4.3.100.0000.02010.52
4.3.90.0030.03010.54
4.3.80.0070.04710.54
4.3.70.0000.02010.55
4.3.60.0000.03710.56
4.3.50.0070.02310.57
4.3.40.0070.04310.57
4.3.30.0070.03010.57
4.3.20.0030.03710.57
4.3.10.0030.03710.58
4.3.00.0030.03310.59

preferences:
44.64 ms | 400 KiB | 5 Q