3v4l.org

run code in 300+ PHP versions simultaneously
<?php function igorRetry($retries, callable $fn) { beginning: try { return $fn(); } catch (\Exception $e) { if (!$retries) { throw new \Exception('', 0, $e); } $retries--; goto beginning; } } $fn = function() { if ($GLOBALS['counter'] > 0) { $GLOBALS['counter']--; throw new \Exception('Try again'); } return 'something successfull'; }; $start = microtime(true); try { $GLOBALS['counter'] = 999999; igorRetry(1000000, $fn); } catch (\Exception $e) {} echo 'Igor retry finished in: ' . (microtime(true) -$start) . "\n";

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.1.70.0470.70815.12
7.1.60.0530.70515.52
7.1.50.0860.59815.12
7.1.40.0470.67815.12
7.1.30.0470.65615.12
7.1.20.0540.63015.12
7.1.10.0470.64415.12
7.1.00.0100.66316.66
7.0.200.0871.06115.12
7.0.190.0830.86115.12
7.0.180.0530.90415.12
7.0.170.0600.96215.12
7.0.160.0460.89415.12
7.0.150.0441.08015.12
7.0.140.0070.89116.52
7.0.130.0130.98216.55
7.0.120.0070.98616.45
7.0.110.0071.10216.45
7.0.100.0000.99616.32
7.0.90.0841.00115.12
7.0.80.0530.93915.12
7.0.70.0530.91715.12
7.0.60.0640.93315.12
7.0.50.0501.02315.12
7.0.40.0031.00315.12
7.0.30.0100.96915.12
7.0.20.0131.13915.12
7.0.10.0101.10315.12
7.0.00.0101.02715.12
5.6.300.0101.61120.91
5.6.290.0271.55020.89
5.6.280.0101.59120.89
5.6.270.0101.78521.05
5.6.260.0461.74221.08
5.6.250.0171.71621.04
5.6.240.0131.78420.97
5.6.230.0171.72820.81
5.6.220.0171.61521.00
5.6.210.0001.52820.95
5.6.200.0031.53920.74
5.6.190.0171.60221.04
5.6.180.0071.52820.73
5.6.170.0101.64820.83
5.6.160.0071.62721.04
5.6.150.0171.76520.93
5.6.140.0101.50220.85
5.6.130.0101.54920.87
5.6.120.0131.68020.74
5.6.110.0201.53320.83
5.6.100.0101.54420.79
5.6.90.0101.53020.92
5.6.80.0071.64820.32
5.6.70.0131.57020.27
5.6.60.0171.51320.20
5.6.50.0071.63820.38
5.6.40.0071.54020.32
5.6.30.0271.54120.23
5.6.20.0101.62120.19
5.6.10.0131.50920.37
5.6.00.0101.44320.35
5.5.380.0001.71517.58
5.5.370.0071.72717.66
5.5.360.0131.74517.59
5.5.350.0071.55317.57
5.5.340.0171.72717.82
5.5.330.0101.58917.84
5.5.320.0001.65418.10
5.5.310.0001.73218.05
5.5.300.0131.71218.13
5.5.290.0131.68318.09
5.5.280.0831.60518.03
5.5.270.0071.67217.68
5.5.260.0071.52618.07
5.5.250.0031.56817.89
5.5.240.0101.61717.45
5.5.230.0101.59017.46
5.5.220.0031.60417.50
5.5.210.0101.58517.46
5.5.200.0171.52517.39
5.5.190.0171.49917.06
5.5.180.0901.56217.42
5.5.160.0071.46817.44
5.5.150.0031.53717.09
5.5.140.0131.52417.49
5.5.130.0131.65917.43
5.5.120.0031.69817.09
5.5.110.0071.54117.09
5.5.100.0071.61817.26
5.5.90.0001.55617.43
5.5.80.0101.65216.96
5.5.70.0031.67317.30
5.5.60.0101.60817.34
5.5.50.0131.65217.34
5.5.40.0201.70617.34
5.5.30.0131.56817.36
5.5.20.0001.62316.98
5.5.10.0031.53517.27
5.5.00.0171.55417.07
5.4.450.0131.71819.41
5.4.440.0131.50219.55
5.4.430.0101.63219.24
5.4.420.0001.67019.50
5.4.410.0071.62619.38
5.4.400.0031.43419.17
5.4.390.0001.60019.12
5.4.380.0131.60819.17
5.4.370.0031.70918.95
5.4.360.0071.63419.04
5.4.350.0031.67019.07
5.4.340.0131.65619.03
5.4.320.0101.60618.81
5.4.310.0131.68618.82
5.4.300.0071.49318.97
5.4.290.0071.65618.85
5.4.280.0701.64819.03
5.4.270.0301.50919.05
5.4.260.0201.56419.02
5.4.250.0131.52818.84
5.4.240.0031.55318.93
5.4.230.0171.84519.07
5.4.220.0071.52719.05
5.4.210.0101.70419.23
5.4.200.0101.55119.20
5.4.190.0031.49119.13
5.4.180.0131.60119.11
5.4.170.0131.44619.03
5.4.160.0101.45119.12
5.4.150.0071.50119.11
5.4.140.0031.55616.59
5.4.130.0101.54116.52
5.4.120.0031.47416.66
5.4.110.0071.60416.56
5.4.100.0101.51216.61
5.4.90.0101.49116.62
5.4.80.0071.57216.75
5.4.70.0071.50516.70
5.4.60.0071.44316.45
5.4.50.0071.49616.75
5.4.40.0131.55116.58
5.4.30.0171.57916.61
5.4.20.0001.75016.71
5.4.10.0201.59416.34
5.4.00.0071.53815.94

preferences:
38.43 ms | 401 KiB | 5 Q