3v4l.org

run code in 300+ PHP versions simultaneously
<?php function decorate(callable $fn, callable $decorator) { return function() use ($fn, $decorator) { $d = $decorator(); $gen = $d(); if (is_array($gen->current())) { $arguments = $gen->current(); } else { $arguments = func_get_args(); } try { $gen->send(call_user_func_array($fn, $arguments)); } catch (\Exception $e) { $gen->throw($e); } }; } function foo($bar) { throw new Exception("Error $bar!"); } function catch_all_exceptions() { return function() { try { (yield); } catch (\Exception $e) { echo "Caught Exception: $e\n"; } }; } $foo = decorate("foo", "catch_all_exceptions"); $foo("bar");

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.0090.00618.43
8.3.50.0080.00821.92
8.3.40.0120.00318.55
8.3.30.0030.01218.67
8.3.20.0080.00018.69
8.3.10.0090.00620.48
8.3.00.0000.00721.96
8.2.180.0070.00716.63
8.2.170.0070.00722.96
8.2.160.0140.00420.28
8.2.150.0070.00724.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00819.48
8.2.110.0090.00019.46
8.2.100.0080.00417.84
8.2.90.0060.00319.22
8.2.80.0080.00017.97
8.2.70.0040.00417.63
8.2.60.0080.00317.55
8.2.50.0050.00318.07
8.2.40.0000.00818.05
8.2.30.0040.00419.76
8.2.20.0040.00417.84
8.2.10.0000.00817.69
8.2.00.0030.00517.61
8.1.280.0170.00325.92
8.1.270.0070.00023.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00319.11
8.1.230.0080.00320.79
8.1.220.0030.00617.79
8.1.210.0050.00318.77
8.1.200.0030.00617.48
8.1.190.0000.00817.54
8.1.180.0070.00018.10
8.1.170.0000.00818.52
8.1.160.0040.00418.82
8.1.150.0000.00718.64
8.1.140.0040.00417.41
8.1.130.0000.00717.89
8.1.120.0000.00917.54
8.1.110.0070.00017.51
8.1.100.0000.00717.34
8.1.90.0000.00817.46
8.1.80.0030.00317.48
8.1.70.0000.00717.45
8.1.60.0050.00317.59
8.1.50.0050.00317.40
8.1.40.0070.00017.53
8.1.30.0000.00817.66
8.1.20.0050.00317.62
8.1.10.0050.00317.48
8.1.00.0040.00417.52
8.0.300.0000.00718.77
8.0.290.0000.00817.18
8.0.280.0030.00318.42
8.0.270.0030.00317.21
8.0.260.0000.00716.84
8.0.250.0050.00317.07
8.0.240.0040.00717.02
8.0.230.0040.00416.93
8.0.220.0070.00016.99
8.0.210.0000.00716.98
8.0.200.0030.00316.89
8.0.190.0000.00716.93
8.0.180.0040.00416.94
8.0.170.0000.00916.92
8.0.160.0070.00317.07
8.0.150.0040.00416.84
8.0.140.0000.00816.84
8.0.130.0000.00613.39
8.0.120.0050.00316.98
8.0.110.0040.00416.91
8.0.100.0000.00716.79
8.0.90.0040.00416.84
8.0.80.0030.01216.93
8.0.70.0030.00517.02
8.0.60.0030.00516.97
8.0.50.0040.00417.00
8.0.30.0090.01117.17
8.0.20.0140.00817.40
8.0.10.0040.00417.10
8.0.00.0170.00516.73
7.4.330.0080.00013.43
7.4.320.0070.00016.53
7.4.300.0000.00616.41
7.4.290.0070.00016.46
7.4.280.0000.00716.61
7.4.270.0070.00016.41
7.4.260.0000.00613.34
7.4.250.0040.00416.45
7.4.240.0040.00416.41
7.4.230.0040.00416.68
7.4.220.0060.01216.62
7.4.210.0080.00716.49
7.4.200.0070.00016.70
7.4.190.0030.00316.77
7.4.160.0100.00716.44
7.4.150.0090.00917.40
7.4.140.0130.00517.86
7.4.130.0100.00716.69
7.4.120.0130.00716.59
7.4.110.0100.00716.60
7.4.100.0130.00316.44
7.4.90.0070.01016.62
7.4.80.0110.00719.04
7.4.70.0120.01216.50
7.4.60.0060.01016.39
7.4.50.0040.00416.59
7.4.40.0030.01322.27
7.4.30.0140.00516.43
7.4.00.0040.01115.18
7.3.330.0000.00613.40
7.3.320.0000.00713.41
7.3.310.0070.00016.47
7.3.300.0040.00416.35
7.3.290.0130.00716.43
7.3.280.0120.00416.40
7.3.270.0100.00717.40
7.3.260.0080.01118.24
7.3.250.0100.00816.42
7.3.240.0140.00316.42
7.3.230.0170.00716.50
7.3.210.0040.01216.45
7.3.200.0100.01019.39
7.3.190.0070.01016.54
7.3.180.0060.00916.47
7.3.170.0130.00316.51
7.3.160.0120.00916.57
7.3.120.0100.00314.89
7.2.330.0130.00616.51
7.2.320.0100.00716.80
7.2.310.0110.00716.68
7.2.300.0100.01016.70
7.2.290.0060.01016.36
7.2.60.0110.00417.02
7.1.200.0030.01015.79
7.1.70.0040.00417.24
7.1.60.0070.01719.40
7.1.50.0100.01016.98
7.1.00.0030.07722.36
7.0.200.0000.00716.79
7.0.140.0000.07722.00
7.0.60.0170.07020.03
7.0.50.0100.05717.89
7.0.40.0070.08720.09
7.0.30.0230.07020.08
7.0.20.0230.08020.19
7.0.10.0070.04020.07
7.0.00.0000.04320.19
5.6.280.0100.06720.93
5.6.210.0100.04720.65
5.6.200.0100.08318.16
5.6.190.0030.04720.42
5.6.180.0300.04020.69
5.6.170.0270.07720.54
5.6.160.0130.06720.52
5.6.150.0030.04018.23
5.6.140.0000.04318.13
5.6.130.0070.08718.29
5.6.120.0030.08321.16
5.6.110.0030.09021.13
5.6.100.0170.05721.00
5.6.90.0030.04721.02
5.6.80.0100.08020.50
5.5.350.4370.04720.43
5.5.340.0070.08017.96
5.5.330.0130.03320.57
5.5.320.0100.08320.51
5.5.310.0300.07020.29
5.5.300.0100.04717.98
5.5.290.0030.07718.13
5.5.280.0130.07720.89
5.5.270.0030.04320.69
5.5.260.0100.08720.88
5.5.250.0130.05020.80
5.5.240.0200.07720.30
5.4.450.3470.03319.37
5.4.440.3470.04019.52
5.4.430.3500.04019.48
5.4.420.3600.03719.54
5.4.410.3470.04019.35
5.4.400.3330.03318.86
5.4.390.3770.03719.06
5.4.380.3470.03318.99
5.4.370.3370.04019.31
5.4.360.3700.03719.11
5.4.350.3430.04018.98
5.4.340.2930.03719.06
5.4.320.3500.03319.06
5.4.310.4330.04319.00
5.4.300.3430.03719.16
5.4.290.3370.03319.14
5.4.280.3270.04018.94
5.4.270.3200.04019.30
5.4.260.3700.04019.22
5.4.250.3730.04719.23
5.4.240.3170.04019.10
5.4.230.2730.03718.98
5.4.220.3470.04018.86
5.4.210.3770.04018.86
5.4.200.3900.03719.14
5.4.190.3530.03319.05
5.4.180.3530.04019.05
5.4.170.3530.03719.13
5.4.160.3100.04319.07
5.4.150.3200.03319.29
5.4.140.2600.02716.55
5.4.130.4200.04716.38
5.4.120.3500.03316.37
5.4.110.3100.03716.59
5.4.100.3230.03316.63
5.4.90.3470.03316.34
5.4.80.3400.03716.22
5.4.70.4370.02316.45
5.4.60.3270.03316.43
5.4.50.3200.03716.43
5.4.40.3230.03316.25
5.4.30.3300.02716.55
5.4.20.2930.03316.54
5.4.10.3000.03716.53
5.4.00.3470.03015.82
5.3.290.3600.03314.69
5.3.280.3600.03714.77
5.3.270.3230.04014.55
5.3.260.3200.03714.63
5.3.250.3470.04314.61
5.3.240.3230.04314.79
5.3.230.3430.03314.62
5.3.220.3230.04014.56
5.3.210.3170.04314.49
5.3.200.3600.04014.75
5.3.190.3230.03714.59
5.3.180.3430.03714.63
5.3.170.3530.04014.48
5.3.160.3630.02714.49
5.3.150.3100.03714.63
5.3.140.3330.03014.48
5.3.130.3200.03314.49
5.3.120.2800.03314.55
5.3.110.2830.03314.58
5.3.100.2570.03314.10
5.3.90.3100.03714.08
5.3.80.3270.04013.96
5.3.70.2870.03314.04
5.3.60.2600.03714.03
5.3.50.3030.03314.03
5.3.40.2970.03713.87
5.3.30.3000.03314.02
5.3.20.3230.03713.72
5.3.10.4500.04713.72
5.3.00.3770.03713.77
5.2.170.2830.02311.12
5.2.160.2870.02711.10
5.2.150.2600.03011.20
5.2.140.2730.03011.05
5.2.130.3200.03011.03
5.2.120.2500.03011.05
5.2.110.2830.03011.02
5.2.100.2870.03011.07
5.2.90.3270.02711.19
5.2.80.3400.03311.21
5.2.70.2970.03311.21
5.2.60.2570.04011.09
5.2.50.2830.03310.94
5.2.40.2530.02710.89
5.2.30.2400.03011.05
5.2.20.2500.02711.07
5.2.10.2470.02710.86
5.2.00.2230.03010.93
5.1.60.2430.03010.07
5.1.50.2370.0279.89
5.1.40.2470.0239.96
5.1.30.2430.02710.25
5.1.20.2530.02310.51
5.1.10.2300.0339.96
5.1.00.2430.02010.05
5.0.50.1370.0278.55
5.0.40.1330.0208.46
5.0.30.1370.0278.15
5.0.20.1270.0178.09
5.0.10.0670.0178.10
5.0.00.1500.0338.14
4.4.90.1370.0205.85
4.4.80.1330.0135.89
4.4.70.1330.0135.81
4.4.60.1070.0175.92
4.4.50.1370.0175.80
4.4.40.1330.0335.82
4.4.30.1200.0175.84
4.4.20.1330.0205.83
4.4.10.1070.0175.91
4.4.00.1370.0305.89
4.3.110.1270.0205.82
4.3.100.1330.0205.86
4.3.90.1100.0135.79
4.3.80.0970.0475.79
4.3.70.1130.0175.79
4.3.60.1200.0175.79
4.3.50.1200.0135.79
4.3.40.1230.0205.79
4.3.30.0530.0205.79
4.3.20.0730.0235.79
4.3.10.0700.0235.79
4.3.00.0770.0205.79

preferences:
41.95 ms | 401 KiB | 5 Q