3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( "0" => 12 , "1" => 17 , "2" => 5, "3" => 27, "4" => 5 ); $i=1; foreach($array as $key=>$values) { $max = max($array); echo "\n".$max." rank is ". $i."\n"; $keys = array_search($max, $array); unset($array[$keys]); if(sizeof($array) >0) if(!in_array($max,$array)) $i++; }

Abusive script

This script was stopped while abusing our resources

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.110.0060.00620.94
8.3.100.0060.00324.06
8.3.90.0050.00226.77
8.3.80.0140.00723.67
8.3.70.0230.00223.73
8.3.60.0140.01024.63
8.3.50.0090.00824.98
8.3.40.0160.00423.15
8.3.30.0090.00922.99
8.3.20.0130.00524.06
8.3.10.0090.00824.59
8.3.00.0120.00523.18
8.2.230.0030.00622.58
8.2.220.0030.00637.54
8.2.210.0030.00526.77
8.2.200.0120.00423.61
8.2.190.0180.00623.78
8.2.180.0130.00528.38
8.2.170.0140.00424.29
8.2.160.0140.00523.98
8.2.150.0130.00423.78
8.2.140.0090.00724.52
8.2.130.0120.00624.91
8.2.120.0140.00523.00
8.2.110.0130.00522.94
8.2.100.0150.00821.41
8.2.90.0200.00520.98
8.2.80.0160.00721.08
8.2.70.0160.00520.95
8.2.60.0130.00620.37
8.2.50.0080.00920.70
8.2.40.0090.00721.00
8.2.30.0100.00520.68
8.2.20.0100.00620.64
8.2.10.0080.00720.65
8.2.00.0110.00320.74
8.1.290.0110.00530.84
8.1.280.0160.00528.38
8.1.270.0130.00525.25
8.1.260.0110.00725.76
8.1.250.0120.00826.21
8.1.240.0120.00621.57
8.1.230.0110.00521.54
8.1.220.0080.00821.16
8.1.210.0100.00721.62
8.1.200.0120.00620.97
8.1.190.0110.00620.39
8.1.180.0110.00620.57
8.1.170.0100.00520.51
8.1.160.0100.00521.13
8.1.150.0100.00520.95
8.1.140.0090.00620.49
8.1.130.0100.00620.48
8.1.120.0090.00420.38
8.1.110.0080.00620.65
8.1.100.0090.00520.77
8.1.90.0070.00620.41
8.1.80.0080.00420.80
8.1.70.0090.00420.63
8.1.60.0110.00320.19
8.1.50.0070.00720.10
8.1.40.0060.00720.21
8.1.30.0100.00520.23
8.1.20.0110.00520.44
8.1.10.0110.00520.07
8.1.00.0080.00720.01
8.0.300.0110.00520.99
8.0.290.0140.00520.07
8.0.280.0140.00619.71
8.0.270.0120.00519.87
8.0.260.0150.00319.63
8.0.250.0140.00519.66
8.0.240.0160.00419.57
8.0.230.0120.00519.73
8.0.220.0090.00719.55
8.0.210.0120.00519.55
8.0.200.0150.00219.67
8.0.190.0130.00219.29
8.0.180.0110.00419.26
8.0.170.0110.00619.27
8.0.160.0080.00719.50
8.0.150.0120.00619.20
8.0.140.0160.00319.22
8.0.130.0150.00418.90
8.0.120.0110.00719.19
8.0.110.0120.00519.23
8.0.100.0110.00519.25
8.0.90.0110.00519.24
8.0.80.0130.00519.21
8.0.70.0080.00619.48
8.0.60.0130.00319.26
8.0.50.0110.00619.23
8.0.30.0090.00618.36
8.0.20.0110.00618.72
8.0.10.0100.00718.68
8.0.00.0100.00819.15
7.4.330.0100.00417.80
7.4.320.0120.00619.12
7.4.300.0130.00519.06
7.4.290.0120.00518.75
7.4.280.0110.00618.75
7.4.270.0120.00618.75
7.4.260.0160.00318.72
7.4.250.0170.00318.70
7.4.240.0150.00518.66
7.4.230.0140.00418.97
7.4.220.0130.00519.30
7.4.210.0130.00618.20
7.4.200.0140.00618.77
7.4.190.0130.00519.00
7.4.180.0140.00619.44
7.4.160.0130.00518.38
7.4.150.0110.00818.45
7.4.140.0130.00618.40
7.4.130.0100.00818.15
7.4.120.0110.00718.00
7.4.110.0120.00717.93
7.4.100.0150.00617.86
7.4.90.0120.00717.60
7.4.80.0130.00817.86
7.4.70.0150.00617.66
7.4.60.0150.00617.64
7.4.50.0120.00817.45
7.4.40.0140.00617.46
7.4.30.0130.00817.52
7.4.20.0140.00817.25
7.4.10.0130.00717.18
7.4.00.0110.00817.24
7.3.330.0170.00218.34
7.3.320.0160.00618.19
7.3.310.0160.00418.56
7.3.300.0140.00518.69
7.3.290.0150.00818.60
7.3.280.0140.00618.05
7.3.270.0140.00718.02
7.3.260.0160.00617.96
7.3.250.0150.00717.83
7.3.240.0150.00617.78
7.3.230.0140.00617.77
7.3.220.0140.00617.79
7.3.210.0140.00617.45
7.3.200.0140.00717.52
7.3.190.0140.00817.51
7.3.180.0130.00717.50
7.3.170.0120.00817.51
7.3.160.0120.00917.26
7.3.150.0140.00717.34
7.3.140.0130.00617.24
7.3.130.0130.00617.10
7.3.120.0120.00816.96
7.3.110.0120.00817.03
7.3.100.0120.00816.62
7.3.90.0150.00816.70
7.3.80.0170.00816.62
7.3.70.0100.00816.34
7.3.60.0110.00816.35
7.3.50.0140.00816.23
7.3.40.0130.00816.22
7.3.30.0110.00816.19
7.3.20.0200.00916.67
7.3.10.0220.00716.65
7.3.00.0230.00716.67
7.2.340.0130.00818.28
7.2.330.0140.00717.61
7.2.320.0130.00817.64
7.2.310.0130.00717.68
7.2.300.0130.00817.66
7.2.290.0130.00717.52
7.2.280.0160.00617.54
7.2.270.0120.00917.43
7.2.260.0140.00717.25
7.2.250.0130.00717.24
7.2.240.0140.00717.19
7.2.230.0120.00816.99
7.2.220.0130.00816.81
7.2.210.0120.00816.78
7.2.200.0120.00816.57
7.2.190.0110.00816.56
7.2.180.0130.00716.45
7.2.170.0160.00816.46
7.2.160.0130.00816.37
7.2.150.0260.00916.98
7.2.140.0240.00716.89
7.2.130.0240.00616.96
7.2.120.0240.00816.93
7.2.110.0280.00716.88
7.2.100.0210.00816.88
7.2.90.0280.00816.83
7.2.80.0260.00716.85
7.2.70.0300.00916.87
7.2.60.0240.00716.81
7.2.50.0250.00716.83
7.2.40.0290.00816.90
7.2.30.0250.00716.93
7.2.20.0270.00816.93
7.2.10.0280.00917.01
7.2.00.0230.00816.99
7.1.330.0150.00816.78
7.1.320.0180.00916.22
7.1.310.0220.00816.20
7.1.300.0200.00716.01
7.1.290.0220.00615.98
7.1.280.0200.00815.87
7.1.270.0240.00815.82
7.1.260.0210.00815.79
7.1.250.0270.00815.72
7.1.240.0290.00815.72
7.1.230.0280.00715.70
7.1.220.0290.00815.72
7.1.210.0280.00815.64
7.1.200.0260.00815.67
7.1.190.0310.00715.69
7.1.180.0290.00815.65
7.1.170.0300.00815.68
7.1.160.0250.00715.72
7.1.150.0280.00615.74
7.1.140.0280.00815.81
7.1.130.0250.00815.80
7.1.120.0250.00815.80
7.1.110.0240.00815.84
7.1.100.0250.00815.83
7.1.90.0200.00815.83
7.1.80.0240.00715.86
7.1.70.0210.00715.76
7.1.60.0260.00817.58
7.1.50.0290.00817.60
7.1.40.0210.00817.49
7.1.30.0230.00817.54
7.1.20.0260.00817.53
7.1.10.0240.00715.77
7.1.00.0210.00815.74
7.0.330.0240.00715.48
7.0.320.0260.00715.45
7.0.310.0260.00715.35
7.0.300.0240.00915.37
7.0.290.0270.00715.43
7.0.280.0280.00815.43
7.0.270.0260.00815.51
7.0.260.0300.00715.49
7.0.250.0250.00715.58
7.0.240.0220.00715.64
7.0.230.0240.00815.62
7.0.220.0220.00915.59
7.0.210.0240.00715.54
7.0.200.0250.00715.52
7.0.190.0330.00715.46
7.0.180.0240.00715.49
7.0.170.0230.00915.50
7.0.160.0270.00815.44
7.0.150.0240.00715.51
7.0.140.0180.00815.50
7.0.130.0200.00815.55
7.0.120.0210.00815.58
7.0.110.0200.00815.59
7.0.100.0210.00915.50
7.0.90.0230.00915.50
7.0.80.0280.00715.55
7.0.70.0200.00815.52
7.0.60.0180.00915.52
7.0.50.0220.00715.59
7.0.40.0220.00815.59
7.0.30.0190.00815.63
7.0.20.0220.00815.56
7.0.10.0210.00815.59
7.0.00.0220.00715.59
5.6.400.0170.00915.73
5.6.390.0140.00915.71
5.6.380.0130.00915.65
5.6.370.0140.00815.62
5.6.360.0160.00715.69
5.6.350.0150.00815.67
5.6.340.0150.00815.65
5.6.330.0140.00915.67
5.6.320.0140.00815.67
5.6.310.0150.00915.65
5.6.300.0130.01416.03
5.6.290.0150.01316.12
5.6.280.0160.01316.10
5.6.270.0140.01316.14
5.6.260.0150.01216.08
5.6.250.0150.01216.13
5.6.240.0140.01416.10
5.6.230.0130.01416.15
5.6.220.0140.01316.10
5.6.210.0210.01116.12
5.6.200.0170.01316.15
5.6.190.0150.01316.12
5.6.180.0150.01316.12
5.6.170.0150.01216.10
5.6.160.0140.01216.08
5.6.150.0160.01216.15
5.6.140.0140.01216.12
5.6.130.0160.01316.11
5.6.120.0150.01316.10
5.6.110.0140.01316.08
5.6.100.0130.01316.06
5.6.90.0140.01216.05
5.6.80.0130.01315.96
5.6.70.0150.01215.97
5.6.60.0130.01316.03
5.6.50.0160.01315.96
5.6.40.0140.01116.00
5.6.30.0150.01315.99
5.6.20.0130.01316.02
5.6.10.0130.01316.04
5.6.00.0150.01215.97
5.5.380.0140.01315.78
5.5.370.0150.01315.79
5.5.360.0160.01215.72
5.5.350.0140.01515.70
5.5.340.0150.01215.78
5.5.330.0150.01215.74
5.5.320.0140.01415.81
5.5.310.0160.01415.78
5.5.300.0130.01415.78
5.5.290.0140.01315.76
5.5.280.0150.01215.76
5.5.270.0150.01215.73
5.5.260.0150.01215.73
5.5.250.0140.01215.74
5.5.240.0150.01215.72
5.5.230.0140.01215.64
5.5.220.0140.01215.65
5.5.210.0150.01215.70
5.5.200.0140.01315.60
5.5.190.0140.01315.68
5.5.180.0140.01315.68
5.5.170.0180.00715.61
5.5.160.0150.01215.63
5.5.150.0140.01215.65
5.5.140.0130.01315.66
5.5.130.0160.01115.62
5.5.120.0160.01315.58
5.5.110.0140.01215.64
5.5.100.0150.01215.67
5.5.90.0120.01315.68
5.5.80.0130.01115.68
5.5.70.0130.01215.65
5.5.60.0130.01215.64
5.5.50.0180.01215.59
5.5.40.0130.01315.67
5.5.30.0130.01315.68
5.5.20.0130.01215.66
5.5.10.0150.01115.60
5.5.00.0130.01315.61
5.4.450.0130.01013.53
5.4.440.0120.01013.51
5.4.430.0120.01013.54
5.4.420.0130.01113.55
5.4.410.0110.01013.50
5.4.400.0110.01013.49
5.4.390.0120.01013.48
5.4.380.0120.01013.49
5.4.370.0110.01013.47
5.4.360.0100.01113.48
5.4.350.0120.01013.47
5.4.340.0110.01113.49
5.4.330.0120.00613.05
5.4.320.0110.01013.50
5.4.310.0120.00913.50
5.4.300.0120.01013.48
5.4.290.0120.00913.48
5.4.280.0110.01013.49
5.4.270.0120.00913.49
5.4.260.0120.01013.49
5.4.250.0110.01013.46
5.4.240.0110.01013.49
5.4.230.0100.01113.46
5.4.220.0120.00913.46
5.4.210.0110.01013.46
5.4.200.0110.01013.46
5.4.190.0120.00913.44
5.4.180.0120.00913.48
5.4.170.0110.01013.46
5.4.160.0110.01013.47
5.4.150.0120.00913.46
5.4.140.0100.01013.33
5.4.130.0130.00913.30
5.4.120.0140.00913.29
5.4.110.0100.01013.30
5.4.100.0120.01113.30
5.4.90.0100.00913.33
5.4.80.0100.01013.32
5.4.70.0160.01013.32
5.4.60.0110.00913.32
5.4.50.0130.00913.31
5.4.40.0110.00913.31
5.4.30.0110.01013.31
5.4.20.0110.01013.32
5.4.10.0120.01013.30
5.4.00.0100.01013.23
5.3.290.0110.01113.25
5.3.280.0100.01113.16
5.3.270.0090.01213.23
5.3.260.0140.00913.23
5.3.250.0090.01113.24
5.3.240.0110.00913.15
5.3.230.0120.01113.19
5.3.220.0100.01113.18
5.3.210.0120.01013.20
5.3.200.0100.01013.18
5.3.190.0100.01013.21
5.3.180.0110.01013.29
5.3.170.0100.01113.27
5.3.160.0140.01013.28
5.3.150.0110.01013.28
5.3.140.0120.01013.27
5.3.130.0110.00913.17
5.3.120.0130.01013.21
5.3.110.0110.01113.21
5.3.100.0120.00913.19
5.3.90.0140.01013.18
5.3.80.0120.01013.09
5.3.70.0100.01113.10
5.3.60.0090.01113.15
5.3.50.0110.00913.16
5.3.40.0100.01013.14
5.3.30.0110.01013.16
5.3.20.0100.01013.06
5.3.10.0100.01013.03
5.3.00.0110.01012.97

preferences:
33.11 ms | 403 KiB | 5 Q