3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Dummy { public $input; function __construct($input = array(1,2,3)) { $this->input = $input; } function run() { foreach($this->input as $key=>$value) { if($key == 2) throw new Exception('hello exception'); } } } function retry(Dummy $dum) { try { $dum->run(); } catch(Exception $e) { // solve the exception if($this->input[2]) unset($this->input[2]); retry($dum); } } $dum = new Dummy; $dum->run();

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.0140.00718.52
8.3.50.0080.01021.93
8.3.40.0070.00718.88
8.3.30.0060.01319.27
8.3.20.0040.00419.96
8.3.10.0080.00022.10
8.3.00.0070.00020.71
8.2.180.0030.01316.63
8.2.170.0040.01122.96
8.2.160.0110.00420.89
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00419.13
8.2.110.0040.00422.11
8.2.100.0130.00019.61
8.2.90.0040.00419.09
8.2.80.0080.00017.97
8.2.70.0040.00417.75
8.2.60.0000.00817.93
8.2.50.0030.00518.07
8.2.40.0030.00618.03
8.2.30.0040.00418.20
8.2.20.0080.00017.66
8.2.10.0030.00517.70
8.2.00.0000.00817.62
8.1.280.0070.01025.92
8.1.270.0040.00422.16
8.1.260.0050.00226.35
8.1.250.0070.00028.09
8.1.240.0050.00323.98
8.1.230.0080.00419.11
8.1.220.0000.00817.79
8.1.210.0060.00318.77
8.1.200.0060.00317.25
8.1.190.0040.00417.53
8.1.180.0030.00518.73
8.1.170.0030.00518.65
8.1.160.0040.00422.00
8.1.150.0040.00418.55
8.1.140.0000.00717.42
8.1.130.0030.00317.70
8.1.120.0000.00717.50
8.1.110.0050.00317.34
8.1.100.0050.00317.29
8.1.90.0040.00317.46
8.1.80.0000.00717.33
8.1.70.0070.00017.39
8.1.60.0040.00417.56
8.1.50.0000.00817.48
8.1.40.0030.00517.41
8.1.30.0050.00317.65
8.1.20.0050.00317.55
8.1.10.0090.00017.46
8.1.00.0030.00617.51
8.0.300.0000.00718.77
8.0.290.0040.00417.04
8.0.280.0000.00818.35
8.0.270.0000.00717.25
8.0.260.0030.00316.79
8.0.250.0000.00716.99
8.0.240.0040.00417.05
8.0.230.0030.00517.05
8.0.220.0000.00717.02
8.0.210.0000.00816.87
8.0.200.0040.00416.99
8.0.190.0050.00316.98
8.0.180.0040.00317.00
8.0.170.0050.00216.97
8.0.160.0000.00716.83
8.0.150.0030.00516.93
8.0.140.0000.00716.76
8.0.130.0000.00613.35
8.0.120.0040.00416.82
8.0.110.0000.00816.90
8.0.100.0040.00416.75
8.0.90.0070.00016.90
8.0.80.0140.00016.91
8.0.70.0000.00716.84
8.0.60.0000.00716.82
8.0.50.0000.00916.77
8.0.30.0100.00916.93
8.0.20.0120.01017.40
8.0.10.0070.00017.02
8.0.00.0070.01116.74
7.4.330.0000.00515.00
7.4.320.0000.00816.54
7.4.300.0030.00316.59
7.4.290.0050.00316.56
7.4.280.0030.00316.58
7.4.270.0000.00716.56
7.4.260.0030.00316.60
7.4.250.0080.00016.44
7.4.240.0060.00116.40
7.4.230.0080.00016.38
7.4.220.0150.00316.52
7.4.210.0090.00516.52
7.4.200.0030.00316.52
7.4.190.0030.00316.39
7.4.160.0110.00816.58
7.4.150.0100.00717.40
7.4.140.0100.00817.86
7.4.130.0110.00616.53
7.4.120.0030.01316.62
7.4.110.0130.00316.71
7.4.100.0130.01016.46
7.4.90.0090.00916.44
7.4.80.0120.00919.39
7.4.70.0090.00916.56
7.4.60.0120.00616.49
7.4.50.0000.00916.49
7.4.40.0070.01022.77
7.4.30.0060.01016.54
7.4.00.0000.01314.96
7.3.330.0050.00013.36
7.3.320.0030.00313.25
7.3.310.0000.00616.27
7.3.300.0030.00316.20
7.3.290.0110.00316.32
7.3.280.0090.00816.37
7.3.270.0030.01317.40
7.3.260.0090.00916.41
7.3.250.0090.01116.64
7.3.240.0060.01116.37
7.3.230.0060.01016.45
7.3.210.0060.01116.45
7.3.200.0070.01016.59
7.3.190.0130.00316.47
7.3.180.0090.00616.62
7.3.170.0100.00716.48
7.3.160.0120.00916.57
7.3.120.0090.00914.85
7.2.330.0090.00916.64
7.2.320.0030.01416.80
7.2.310.0000.01716.47
7.2.300.0030.01316.38
7.2.290.0100.01016.72
7.2.60.0090.00916.82
7.2.00.0070.00319.50
7.1.200.0110.00715.52
7.1.100.0030.01018.08
7.1.70.0060.00616.95
7.1.60.0070.01819.82
7.1.50.0030.00916.85
7.1.00.0030.07722.28
7.0.200.0100.00316.51
7.0.140.0070.07321.95
7.0.60.0070.05719.92
7.0.50.0070.08017.73
7.0.40.0070.08719.96
7.0.30.0230.09020.23
7.0.20.0230.05720.20
7.0.10.0070.08020.19
7.0.00.0100.08020.12
5.6.280.0030.07320.79
5.6.210.0000.08720.72
5.6.200.0100.06318.16
5.6.190.0030.05720.64
5.6.180.0600.06020.57
5.6.170.0170.04320.39
5.6.160.0030.08320.71
5.6.150.0100.05018.13
5.6.140.0030.04018.25
5.6.130.0070.08718.23
5.6.120.0130.08321.00
5.6.110.0100.03321.15
5.6.100.0130.07320.99
5.6.90.0070.08321.00
5.6.80.0130.04320.54
5.5.350.0070.03320.43
5.5.340.0030.08317.95
5.5.330.0030.06020.27
5.5.320.0130.06320.52
5.5.310.0230.04020.46
5.5.300.0070.04018.08
5.5.290.0100.04317.98
5.5.280.0070.06020.77
5.5.270.0130.06720.86
5.5.260.0100.07320.80
5.5.250.0070.03720.72
5.5.240.0000.05720.13
5.4.450.0200.05319.64
5.4.440.0330.04719.51
5.4.430.0070.08019.47
5.4.420.0100.05719.36
5.4.410.0130.05719.58
5.4.400.0770.00018.75
5.4.390.3600.00018.41
5.4.380.0300.05018.47
5.4.370.0800.05718.72
5.4.360.0730.04718.84
5.4.350.1000.05318.80
5.4.340.0970.04318.53
5.4.320.0070.04712.51
5.4.310.0040.04712.50
5.4.300.0110.03512.51
5.4.290.0080.03512.50
5.4.280.0100.03912.40
5.4.270.0090.03712.40
5.4.260.0270.04318.94
5.4.250.0230.04718.99
5.4.240.0130.04718.65
5.4.230.0200.05319.00
5.4.220.0200.06318.80
5.4.210.0030.06018.79
5.4.200.0100.05018.77
5.4.190.0200.05018.93
5.4.180.0130.06318.77
5.4.170.0130.05718.99
5.4.160.0030.06318.79
5.4.150.0130.06318.99
5.4.140.0130.05016.48
5.4.130.0070.05016.47
5.4.120.0070.06316.47
5.4.110.0030.05716.70
5.4.100.0100.06716.66
5.4.90.0030.05316.63
5.4.80.0100.05016.68
5.4.70.0100.05716.52
5.4.60.0070.07716.48
5.4.50.0070.05316.40
5.4.40.0100.07016.41
5.4.30.0070.06716.52
5.4.20.0170.06716.50
5.4.10.0030.07316.47
5.4.00.0070.05716.03
5.3.290.0080.04012.80
5.3.280.0130.06314.71
5.3.270.0100.05014.68
5.3.260.0100.07714.70
5.3.250.0100.05314.52
5.3.240.0030.07714.59
5.3.230.0170.05314.83
5.3.220.0170.04014.75
5.3.210.0030.06014.56
5.3.200.0130.07714.67
5.3.190.0030.06714.71
5.3.180.0130.04714.71
5.3.170.0100.07314.66
5.3.160.0270.05014.75
5.3.150.0100.05314.54
5.3.140.0100.05014.64
5.3.130.0000.07714.56
5.3.120.0100.05314.46
5.3.110.0070.08014.46
5.3.100.0100.07014.18
5.3.90.0130.07014.00
5.3.80.0030.06014.11
5.3.70.0100.04714.11

preferences:
48.18 ms | 401 KiB | 5 Q