3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo rand();die(); class ExceptionX extends Exception { } class ExceptionY extends Exception { } class ExceptionZ extends Exception { } function t() { throw new ExceptionZ(); } try { t(); } catch (Exception $e) { switch(get_class($e)) { case 'ExceptionX': /** fall through */ case 'ExceptionY': /** fall through */ /* handle the ones we want here */ break; default: throw $e; } }

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.2.00.0040.01119.46
7.1.70.0030.00616.70
7.1.60.0040.01519.24
7.1.50.0110.01416.94
7.1.00.0000.09322.36
7.0.200.0120.00016.65
7.0.140.0070.07022.15
7.0.60.0100.05021.85
7.0.50.0030.08317.78
7.0.40.0030.07720.04
7.0.30.0130.04720.09
7.0.20.0230.05020.16
7.0.10.0100.04720.30
7.0.00.0030.07720.22
5.6.280.0070.07021.13
5.6.210.0100.05720.52
5.6.200.0130.07318.19
5.6.190.0000.09020.39
5.6.180.0430.07020.57
5.6.170.0330.07320.50
5.6.160.0100.08020.48
5.6.150.0070.03718.13
5.6.140.0070.03318.21
5.6.130.0100.04318.19
5.6.120.0070.08020.98
5.6.110.0100.08021.00
5.6.100.0100.08320.98
5.6.90.0030.04320.97
5.6.80.0100.07320.55
5.5.350.0300.07020.40
5.5.340.0030.06717.98
5.5.330.0030.06020.21
5.5.320.0370.04320.31
5.5.310.0230.07320.27
5.5.300.0100.06717.95
5.5.290.0130.08017.98
5.5.280.0000.04720.89
5.5.270.0070.07320.66
5.5.260.0070.07720.66
5.5.250.0200.07020.51
5.5.240.0030.07720.37
5.4.450.4200.04019.59
5.4.440.3900.04019.30
5.4.430.3630.03019.45
5.4.420.4130.04019.27
5.4.410.3670.03319.46
5.4.400.4500.04719.18
5.4.390.4500.03719.06
5.4.380.5500.03319.21
5.4.370.4100.04318.99
5.4.360.4530.03719.26
5.4.350.4000.04319.17
5.4.340.4000.03719.23
5.4.320.4400.03319.22
5.4.310.4130.03718.95
5.4.300.3870.03018.93
5.4.290.3770.04318.98
5.4.280.4670.03719.13
5.4.270.4170.04019.17
5.4.260.4270.04019.12
5.4.250.3670.03019.23
5.4.240.3700.03719.10
5.4.230.3670.03719.16
5.4.220.3700.03719.21
5.4.210.3600.03019.14
5.4.200.3770.04019.25
5.4.190.3930.03718.93
5.4.180.3870.03319.23
5.4.170.4500.04018.96
5.4.160.4700.03319.05
5.4.150.4600.03319.09
5.4.140.4670.03716.55
5.4.130.4530.03716.43
5.4.120.4070.03716.55
5.4.110.4170.03716.53
5.4.100.4300.03716.56
5.4.90.4570.03716.27
5.4.80.4670.02716.58
5.4.70.4630.03316.56
5.4.60.4470.03316.21
5.4.50.4870.04316.54
5.4.40.4030.04016.62
5.4.30.3930.03316.41
5.4.20.3830.03316.34
5.4.10.4500.03716.45
5.4.00.4430.03315.89
5.3.290.4430.03314.69
5.3.280.3130.04014.65
5.3.270.4170.03714.64
5.3.260.4600.03714.64
5.3.250.4630.03314.77
5.3.240.4530.03314.78
5.3.230.4870.04014.77
5.3.220.3530.04014.66
5.3.210.3530.04014.47
5.3.200.4030.03714.61
5.3.190.4130.04714.74
5.3.180.4430.04314.50
5.3.170.4300.03314.50
5.3.160.4600.03714.65
5.3.150.4530.04014.63
5.3.140.4170.03714.62
5.3.130.4170.03714.61
5.3.120.4000.03314.71
5.3.110.3800.04314.45
5.3.100.4330.04013.95
5.3.90.3930.03714.18
5.3.80.3900.04013.96
5.3.70.4230.04313.93
5.3.60.4430.03314.16
5.3.50.4770.04014.00
5.3.40.4070.03713.97
5.3.30.3930.03713.94
5.3.20.4930.04313.73
5.3.10.4530.03013.84
5.3.00.4600.03713.71
5.2.170.3100.03011.06
5.2.160.3400.03011.32
5.2.150.3500.02011.16
5.2.140.3570.03011.18
5.2.130.3830.03311.30
5.2.120.3900.03011.17
5.2.110.3470.03311.15
5.2.100.3870.02711.19
5.2.90.3830.03311.18
5.2.80.3870.02311.27
5.2.70.3570.03311.17
5.2.60.3470.03311.08
5.2.50.3770.03010.99
5.2.40.2930.03311.06
5.2.30.2970.02710.99
5.2.20.2900.02311.00
5.2.10.3170.03710.88
5.2.00.3030.02310.73
5.1.60.3200.0239.97
5.1.50.3270.03010.03
5.1.40.2970.03010.14
5.1.30.2670.03010.40
5.1.20.2430.03010.38
5.1.10.2300.02310.08
5.1.00.2670.03010.04
5.0.50.1230.0208.61
5.0.40.1200.0208.39
5.0.30.1330.0378.31
5.0.20.1230.0208.24
5.0.10.1430.0208.09
5.0.00.1500.0378.13
4.4.90.1670.0136.05
4.4.80.1730.0206.05
4.4.70.1430.0176.05
4.4.60.1770.0176.05
4.4.50.1100.0136.05
4.4.40.1700.0276.05
4.4.30.1600.0176.05
4.4.20.1430.0206.05
4.4.10.1430.0106.05
4.4.00.1530.0276.05
4.3.110.1570.0206.05
4.3.100.1570.0176.05
4.3.90.1470.0136.05
4.3.80.1730.0236.05
4.3.70.1630.0176.05
4.3.60.1630.0206.05
4.3.50.1670.0136.05
4.3.40.1830.0236.05
4.3.30.0870.0176.05
4.3.20.1030.0206.05
4.3.10.0970.0236.05
4.3.00.0830.0176.05

preferences:
35.26 ms | 401 KiB | 5 Q