3v4l.org

run code in 300+ PHP versions simultaneously
<?php function retry($retries, callable $fn) { beginning: try { return $fn(); } catch (\Exception $e) { if (!$retries) { throw new \Exception('', 0, $e); } $retries--; goto beginning; } } $fn = function() { if (mt_rand(0, 5) === 0) { return true; } throw new \Exception('nope'); }; retry(10, $fn);

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.4.10.0120.00814.90
7.4.00.0070.01314.91
7.3.130.0030.01514.75
7.3.120.0040.01414.80
7.3.110.0070.01314.77
7.3.100.0080.00815.05
7.3.90.0060.01314.95
7.3.80.0110.00714.75
7.3.70.0000.01114.66
7.3.60.0100.00314.68
7.3.50.0070.00314.83
7.3.40.0030.01014.87
7.3.30.0090.00614.86
7.3.20.0000.01216.41
7.3.10.0070.00516.71
7.3.00.0030.01116.71
7.2.260.0090.00914.64
7.2.250.0030.01615.11
7.2.240.0000.01515.14
7.2.230.0060.00614.92
7.2.220.0100.00614.96
7.2.210.0070.00715.07
7.2.200.0090.00614.59
7.2.190.0030.00914.99
7.2.180.0000.01515.14
7.2.170.0000.01314.84
7.2.160.0000.01214.69
7.2.150.0030.01016.95
7.2.140.0070.01116.60
7.2.130.0060.00916.88
7.2.120.0060.00516.73
7.2.110.0070.00716.80
7.2.100.0070.00616.80
7.2.90.0050.00916.83
7.2.80.0050.00916.65
7.2.70.0050.01016.94
7.2.60.0020.01416.83
7.2.50.0080.00716.71
7.2.40.0120.00517.04
7.2.30.0090.00517.04
7.2.20.0030.01016.82
7.2.10.0070.01016.86
7.2.00.0050.00617.85
7.1.330.0000.01315.68
7.1.320.0070.01115.86
7.1.310.0030.01215.75
7.1.300.0100.00315.56
7.1.290.0080.00515.85
7.1.280.0040.00415.57
7.1.270.0120.00315.84
7.1.260.0000.01016.02
7.1.250.0050.00815.68
7.1.240.0090.00315.60
7.1.230.0070.00715.40
7.1.220.0090.00015.61
7.1.210.0030.00615.79
7.1.200.0110.00415.82
7.1.190.0060.01015.88
7.1.180.0070.00715.77
7.1.170.0130.00315.80
7.1.160.0060.00615.68
7.1.150.0040.00715.77
7.1.140.0070.01015.83
7.1.130.0040.01115.43
7.1.120.0060.00616.02
7.1.110.0030.01015.78
7.1.100.0030.00915.63
7.1.90.0030.01315.78
7.1.80.0070.01115.75
7.1.70.0020.01016.53
7.1.60.0100.00217.55
7.1.50.0060.01316.40
7.1.40.0070.00715.80
7.1.30.0040.01115.66
7.1.20.0030.00615.79
7.1.10.0030.01015.53
7.1.00.0060.04119.04
7.0.330.0040.00715.44
7.0.320.0100.00315.58
7.0.310.0060.00615.47
7.0.300.0110.00415.18
7.0.290.0060.00615.55
7.0.280.0040.00815.56
7.0.270.0100.00315.48
7.0.260.0040.00715.37
7.0.250.0070.00715.46
7.0.240.0030.00615.22
7.0.230.0090.00615.59
7.0.220.0030.01615.59
7.0.210.0060.00315.46
7.0.200.0160.00715.01
7.0.190.0040.00915.07
7.0.180.0060.00315.47
7.0.170.0060.00915.36
7.0.160.0030.00615.40
7.0.150.0100.00315.39
7.0.140.0020.04318.69
7.0.130.0090.00015.48
7.0.120.0070.01015.16
7.0.110.0100.00315.43
7.0.100.0080.00615.57
7.0.90.0040.00815.51
7.0.80.0030.01015.46
7.0.70.0040.01115.20
7.0.60.0090.04517.64
7.0.50.0050.03816.70
7.0.40.0080.02216.82
7.0.30.0180.03016.73
7.0.20.0160.03616.86
7.0.10.0050.02616.92
7.0.00.0080.03216.77
5.6.400.0080.00814.39
5.6.390.0100.00314.01
5.6.380.0040.00814.17
5.6.370.0080.00814.53
5.6.360.0030.01314.61
5.6.350.0060.00614.50
5.6.340.0030.01013.99
5.6.330.0030.00714.63
5.6.320.0030.01314.08
5.6.310.0060.00614.12
5.6.300.0040.00413.98
5.6.290.0030.00614.31
5.6.280.0080.04217.73
5.6.270.0130.00614.32
5.6.260.0110.00314.64
5.6.250.0080.00814.32
5.6.240.0090.00014.22
5.6.230.0140.00314.35
5.6.220.0030.00614.12
5.6.210.0110.04017.34
5.6.200.0100.03816.27
5.6.190.0050.02517.55
5.6.180.0130.02517.46
5.6.170.0130.02217.36
5.6.160.0070.04317.39
5.6.150.0060.04516.34
5.6.140.0090.04316.30
5.6.130.0040.02616.27
5.6.120.0130.03517.59
5.6.110.0100.04517.60
5.6.100.0110.04117.67
5.6.90.0020.04417.62
5.6.80.0050.04517.25
5.6.70.1740.02017.35
5.6.60.0000.01114.34
5.6.50.0070.00314.05
5.6.40.0030.00713.96
5.6.30.0100.00014.16
5.6.20.0120.00414.02
5.6.10.0120.00314.16
5.6.00.0120.00314.38
5.5.380.0040.01114.29
5.5.370.0030.01314.10
5.5.360.0000.00814.64
5.5.350.0100.03717.28
5.5.340.0080.04216.08
5.5.330.0050.02817.36
5.5.320.0250.03817.35
5.5.310.0150.02317.39
5.5.300.0060.02415.98
5.5.290.0000.03015.97
5.5.280.0100.02517.56
5.5.270.0090.04417.39
5.5.260.0160.01817.47
5.5.250.0170.03717.48
5.5.240.0080.04017.10
5.5.230.0030.00914.38
5.5.220.0060.00614.20
5.5.210.0040.00714.21
5.5.200.0030.00914.33
5.5.190.0070.00714.20
5.5.180.0080.00313.89
5.5.170.0090.00614.13
5.5.160.0000.01414.23
5.5.150.0100.00314.00
5.5.140.0070.00713.95
5.5.130.0060.00614.07
5.5.120.0070.00714.06
5.5.110.0000.00913.89
5.5.100.0000.01714.43
5.5.90.0140.00314.11
5.5.80.0060.01014.33
5.5.70.0030.00913.88
5.5.60.0060.00614.10
5.5.50.0000.00914.20
5.5.40.0040.01114.07
5.5.30.0030.00614.34
5.5.20.0030.01113.96
5.5.10.0000.00813.81
5.5.00.0040.01113.79
5.4.450.0130.01715.39
5.4.440.0080.02315.28
5.4.430.0120.01915.34
5.4.420.0170.01715.42
5.4.410.0140.02215.28
5.4.400.0050.02115.20
5.4.390.0030.02715.29
5.4.380.0080.02315.06
5.4.370.0160.02115.08
5.4.360.0110.01915.24
5.4.350.0100.02015.23
5.4.340.0110.02315.15
5.4.330.0050.00211.36
5.4.320.0120.03715.07
5.4.310.0120.01815.24
5.4.300.0120.02515.29
5.4.290.0160.01515.26
5.4.280.0110.02115.18
5.4.270.0170.01415.13
5.4.260.0130.03015.34
5.4.250.0120.02615.21
5.4.240.0100.03115.18
5.4.230.0070.02415.13
5.4.220.0100.02115.05
5.4.210.0100.02115.26
5.4.200.0130.01815.28
5.4.190.0070.02315.20
5.4.180.0130.01815.30
5.4.170.0100.02015.21
5.4.160.0130.01815.25
5.4.150.0120.04015.17
5.4.140.0020.03013.86
5.4.130.0100.02513.91
5.4.120.0100.02213.84
5.4.110.0100.02813.98
5.4.100.0100.02813.77
5.4.90.0060.03813.85
5.4.80.0120.03713.80
5.4.70.0100.02613.93
5.4.60.0120.02113.92
5.4.50.0080.04213.93
5.4.40.0100.02113.84
5.4.30.0130.04013.94
5.4.20.0090.02013.89
5.4.10.0150.03813.84
5.4.00.0100.03313.61
5.3.290.0230.04314.68
5.3.280.0230.05314.50
5.3.270.0300.06314.83
5.3.260.0170.07014.66
5.3.250.0170.03714.53
5.3.240.0100.04314.66
5.3.230.0130.06714.65
5.3.220.0330.05014.48
5.3.210.0170.04714.79
5.3.200.0270.05314.62
5.3.190.0130.05714.56
5.3.180.0230.04714.54
5.3.170.0230.04014.79
5.3.160.0170.06014.46
5.3.150.0070.03314.55
5.3.140.0630.05014.53
5.3.130.1770.04314.66
5.3.120.1770.05014.54
5.3.110.1730.04314.63
5.3.100.1670.05014.13
5.3.90.1630.03313.96
5.3.80.1530.04014.04
5.3.70.1870.03713.95
5.3.60.1700.03313.92
5.3.50.1600.03014.11
5.3.40.1600.03013.97
5.3.30.1700.03313.82
5.3.20.0030.03313.60
5.3.10.0070.04713.58
5.3.00.0700.05013.55
5.2.170.1530.03711.20
5.2.160.1570.03311.05
5.2.150.1330.03311.09
5.2.140.1300.03011.29
5.2.130.1300.02711.16
5.2.120.1300.02711.01
5.2.110.1300.03011.10
5.2.100.1330.02311.02
5.2.90.1330.02711.11
5.2.80.1400.02311.04
5.2.70.1300.02711.10
5.2.60.1600.03011.19
5.2.50.1330.02310.93
5.2.40.0830.02310.89
5.2.30.0070.02710.89
5.2.20.0030.02711.05
5.2.10.0030.03310.84
5.2.00.0530.03310.61
5.1.60.1030.0279.97
5.1.50.1000.02710.15
5.1.40.1030.0209.98
5.1.30.1070.03310.34
5.1.20.1000.02310.28
5.1.10.1370.03010.05
5.1.00.1300.0339.95
5.0.50.0670.0208.60
5.0.40.0600.0278.48
5.0.30.0600.0378.12
5.0.20.0600.0208.36
5.0.10.0530.0238.25
5.0.00.0630.0508.09
4.4.90.0700.0207.79
4.4.80.0500.0177.79
4.4.70.0530.0137.79
4.4.60.0630.0177.79
4.4.50.0600.0207.79
4.4.40.0470.0237.79
4.4.30.0030.0277.79
4.4.20.0000.0207.79
4.4.10.0030.0337.79
4.4.00.0000.0377.79
4.3.110.0000.0337.79
4.3.100.0000.0307.79
4.3.90.0030.0237.79
4.3.80.0130.0237.79
4.3.70.0470.0177.79
4.3.60.0470.0177.79
4.3.50.0630.0177.79
4.3.40.0670.0407.79
4.3.30.0400.0307.79
4.3.20.0270.0177.79
4.3.10.0270.0137.79
4.3.00.0370.0237.79

preferences:
34.91 ms | 401 KiB | 5 Q