3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0]; $max = 0; for ($i = 0, $l = ceil(count($arr)) / 2; $i < $l; $i++) { if ($arr[$i] > $max) { $max = $arr[$i]; } } for ($l = count($arr); $i < $l; $i++) { if ($arr[$i] > $max) { $max = $arr[$i++]; break; } } echo "$max in $i iterations";

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.0130.00318.21
8.3.50.0210.00821.92
8.3.40.0110.00418.67
8.3.30.0100.00320.32
8.3.20.0000.00818.65
8.3.10.0000.00820.92
8.3.00.0090.00019.79
8.2.180.0090.00916.38
8.2.170.0100.00722.96
8.2.160.0070.00720.22
8.2.150.0040.00424.18
8.2.140.0020.00524.66
8.2.130.0050.00226.16
8.2.120.0040.00419.89
8.2.110.0090.00319.39
8.2.100.0120.00017.89
8.2.90.0040.00419.20
8.2.80.0040.00419.27
8.2.70.0060.00317.50
8.2.60.0040.00418.04
8.2.50.0020.00918.07
8.2.40.0000.00819.89
8.2.30.0040.00419.41
8.2.20.0000.00717.61
8.2.10.0000.00817.83
8.2.00.0030.00517.82
8.1.280.0120.00325.92
8.1.270.0080.00023.99
8.1.260.0060.01226.35
8.1.250.0080.00028.09
8.1.240.0060.00322.45
8.1.230.0080.00420.89
8.1.220.0060.00318.77
8.1.210.0060.00318.82
8.1.200.0030.00617.36
8.1.190.0040.00417.53
8.1.180.0040.00418.10
8.1.170.0000.00918.46
8.1.160.0050.00318.81
8.1.150.0000.00718.69
8.1.140.0000.00717.34
8.1.130.0000.00717.89
8.1.120.0040.00417.49
8.1.110.0000.00817.50
8.1.100.0050.00317.49
8.1.90.0040.00417.54
8.1.80.0040.00417.37
8.1.70.0030.00317.34
8.1.60.0060.00317.59
8.1.50.0040.00417.39
8.1.40.0030.00617.59
8.1.30.0040.00417.71
8.1.20.0000.00917.67
8.1.10.0070.00017.57
8.1.00.0020.00517.57
8.0.300.0040.00419.98
8.0.290.0000.00717.18
8.0.280.0000.00818.46
8.0.270.0040.00417.27
8.0.260.0000.00616.82
8.0.250.0040.00416.96
8.0.240.0080.00016.94
8.0.230.0000.00716.94
8.0.220.0000.00816.93
8.0.210.0000.00616.97
8.0.200.0030.00316.95
8.0.190.0000.00716.95
8.0.180.0040.00416.98
8.0.170.0040.00416.93
8.0.160.0050.00316.80
8.0.150.0070.00016.89
8.0.140.0000.00716.87
8.0.130.0000.00513.42
8.0.120.0060.00316.90
8.0.110.0030.00316.89
8.0.100.0040.00416.72
8.0.90.0050.00316.89
8.0.80.0100.01016.83
8.0.70.0070.00016.76
8.0.60.0080.00016.94
8.0.50.0030.00516.96
8.0.30.0160.00517.17
8.0.20.0100.00917.40
8.0.10.0030.00517.02
8.0.00.0100.00816.85
7.4.330.0050.00016.67
7.4.320.0000.00716.53
7.4.300.0030.00316.59
7.4.290.0030.00316.51
7.4.280.0030.00316.62
7.4.270.0030.00316.54
7.4.260.0060.00013.40
7.4.250.0040.00416.61
7.4.240.0000.00716.66
7.4.230.0000.00716.59
7.4.220.0120.00916.63
7.4.210.0070.00716.58
7.4.200.0000.00716.51
7.4.190.0060.00016.72
7.4.160.0070.01016.43
7.4.150.0070.01117.40
7.4.140.0080.01017.86
7.4.130.0150.00616.54
7.4.120.0140.00516.42
7.4.110.0060.01116.31
7.4.100.0120.00616.58
7.4.90.0100.00716.49
7.4.80.0090.00619.39
7.4.70.0040.01416.37
7.4.60.0110.00716.50
7.4.50.0060.00316.35
7.4.40.0070.00722.77
7.4.30.0250.00016.59
7.4.00.0030.01315.23
7.3.330.0000.00513.21
7.3.320.0050.00013.19
7.3.310.0040.00416.41
7.3.300.0030.00316.22
7.3.290.0100.00716.38
7.3.280.0100.00716.34
7.3.270.0090.00617.40
7.3.260.0120.00918.24
7.3.250.0040.01616.34
7.3.240.0070.01016.47
7.3.230.0110.00716.39
7.3.210.0070.01016.29
7.3.200.0090.01219.39
7.3.190.0130.00916.48
7.3.180.0000.01516.30
7.3.170.0060.01516.55
7.3.160.0110.01116.48
7.3.120.0030.01014.68
7.2.330.0110.00716.77
7.2.320.0060.01216.36
7.2.310.0090.01216.69
7.2.300.0160.00016.75
7.2.290.0030.01316.39
7.2.60.0030.01316.87
7.1.200.0060.00615.93
7.1.100.0070.01018.22
7.1.70.0040.00417.03
7.1.60.0070.01319.24
7.1.50.0140.01016.99
7.1.00.0030.06022.36
7.0.200.0030.01416.88
7.0.140.0030.07721.98
7.0.60.0070.08020.02
7.0.50.0030.08717.89
7.0.40.0030.08320.06
7.0.30.0230.03720.00
7.0.20.0230.04720.22
7.0.10.0030.04320.18
7.0.00.0030.04320.08
5.6.280.0000.10320.99
5.6.210.0100.05020.68
5.6.200.0100.07718.21
5.6.190.0030.09020.67
5.6.180.0170.07320.60
5.6.170.0230.04020.51
5.6.160.0070.08020.48
5.6.150.0130.06018.20
5.6.140.0130.07318.21
5.6.130.0100.07318.14
5.6.120.0130.07721.05
5.6.110.0100.03721.02
5.6.100.0100.06320.98
5.6.90.0170.06721.01
5.6.80.0130.08020.40
5.5.350.0000.04020.39
5.5.340.0070.04017.91
5.5.330.0100.06720.47
5.5.320.0200.08020.11
5.5.310.0270.04720.17
5.5.300.0030.08317.92
5.5.290.0070.04317.96
5.5.280.0030.08720.88
5.5.270.0100.08320.94
5.5.260.0130.06320.67
5.5.250.0100.05020.46
5.5.240.0370.06320.26
5.4.450.2570.04019.37
5.4.440.2330.03719.14
5.4.430.2270.04319.54
5.4.420.2100.04019.42
5.4.410.2570.04019.27
5.4.400.2600.03719.11
5.4.390.2500.03719.06
5.4.380.2230.03019.07
5.4.370.1930.03319.08
5.4.360.2000.03719.16
5.4.350.2070.03019.08
5.4.340.2130.04019.25
5.4.320.2000.03719.13
5.4.310.2270.04719.08
5.4.300.2330.03719.08
5.4.290.2330.03719.07
5.4.280.2300.03718.80
5.4.270.2230.04719.09
5.4.260.2000.03718.80
5.4.250.0430.05019.24
5.4.240.0100.07019.05
5.4.230.0030.04018.80
5.4.220.0800.08019.05
5.4.210.2000.03719.21
5.4.200.2200.03719.25
5.4.190.2370.03319.24
5.4.180.2270.04019.08
5.4.170.2230.03718.91
5.4.160.2330.03718.89
5.4.150.2030.04019.12
5.4.140.2230.04016.27
5.4.130.2200.04716.16
5.4.120.2230.03716.24
5.4.110.2030.04016.21
5.4.100.2230.04016.40
5.4.90.1870.04716.38
5.4.80.2400.03016.48
5.4.70.2270.04316.20
5.4.60.2200.03716.20
5.4.50.2400.03316.41
5.4.40.2170.03316.34
5.4.30.2230.03716.43
5.4.20.2200.04016.03
5.4.10.2270.03716.41
5.4.00.2300.03315.63
5.3.290.2170.04714.51
5.3.280.2300.04014.47
5.3.270.2130.03714.54
5.3.260.2370.03714.62
5.3.250.1830.05014.46
5.3.240.1930.03714.48
5.3.230.2170.04314.69
5.3.220.1970.03714.47
5.3.210.2170.04014.66
5.3.200.2100.04014.52
5.3.190.2100.04714.42
5.3.180.1930.03714.66
5.3.170.2000.03314.41
5.3.160.2370.04314.58
5.3.150.1900.04314.41
5.3.140.2170.03314.43
5.3.130.2230.04014.35
5.3.120.2430.03714.46
5.3.110.2370.04014.39
5.3.100.2070.02714.09
5.3.90.2100.03314.02
5.3.80.2100.03313.96
5.3.70.2200.03714.06
5.3.60.1870.03313.84
5.3.50.1970.03013.89
5.3.40.2200.04013.89
5.3.30.2170.04013.74
5.3.20.2200.04013.56
5.3.10.2200.04313.60
5.3.00.1770.03713.65
5.2.170.1930.03011.16
5.2.160.1900.03311.15
5.2.150.1700.02711.04
5.2.140.1830.03311.00
5.2.130.1970.03011.20
5.2.120.1900.03310.94
5.2.110.1970.03011.11
5.2.100.2000.02310.95
5.2.90.1870.04010.93
5.2.80.1970.02711.04
5.2.70.1670.03011.14
5.2.60.1830.03010.93
5.2.50.1970.03310.95
5.2.40.1570.02010.88
5.2.30.1530.03010.88
5.2.20.1600.03310.84
5.2.10.1530.02710.77
5.2.00.1600.03010.66
5.1.60.1700.02310.07
5.1.50.1600.03010.06
5.1.40.1630.02710.02
5.1.30.1470.03010.30
5.1.20.1300.02710.46
5.1.10.1570.0279.94
5.1.00.1600.0239.94
5.0.50.0700.0178.43
5.0.40.0870.0338.27
5.0.30.0870.0438.30
5.0.20.0770.0238.27
5.0.10.0800.0208.24
5.0.00.0900.0408.20
4.4.90.0670.0177.11
4.4.80.0670.0177.11
4.4.70.0770.0237.11
4.4.60.0770.0207.11
4.4.50.0870.0237.11
4.4.40.0900.0337.11
4.4.30.0870.0207.11
4.4.20.0670.0177.11
4.4.10.0670.0137.11
4.4.00.0800.0277.11
4.3.110.0870.0237.11
4.3.100.0830.0237.11
4.3.90.0770.0137.11
4.3.80.0730.0237.11
4.3.70.0900.0207.11
4.3.60.0900.0237.11
4.3.50.0770.0177.11
4.3.40.0730.0207.11
4.3.30.0370.0237.11
4.3.20.0400.0237.11
4.3.10.0330.0177.11
4.3.00.0400.0207.11

preferences:
40.62 ms | 401 KiB | 5 Q