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() { throw new Exception("Error!"); } function catch_all_exceptions() { return function() { try { (yield ["foo" => "bar"]); } catch (\Exception $e) { echo "Caught Exception: $e\n"; } }; } $foo = decorate("foo", "catch_all_exceptions"); $foo();

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.40.0090.00618.79
8.3.30.0100.00319.12
8.3.20.0040.00420.20
8.3.10.0080.00023.48
8.3.00.0080.00020.95
8.2.170.0090.00922.96
8.2.160.0110.00420.29
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0070.01026.16
8.2.120.0000.00820.94
8.2.110.0030.00722.11
8.2.100.0030.00917.84
8.2.90.0040.00419.22
8.2.80.0040.00417.97
8.2.70.0040.00417.38
8.2.60.0030.00518.04
8.2.50.0040.00418.07
8.2.40.0030.00617.93
8.2.30.0080.00017.98
8.2.20.0040.00417.84
8.2.10.0060.00319.44
8.2.00.0000.00717.79
8.1.270.0080.00023.96
8.1.260.0030.00626.35
8.1.250.0000.00828.09
8.1.240.0100.00023.75
8.1.230.0070.00419.02
8.1.220.0060.00317.74
8.1.210.0030.00618.77
8.1.200.0040.00417.48
8.1.190.0040.00417.65
8.1.180.0050.00318.10
8.1.170.0100.00318.45
8.1.160.0040.00422.03
8.1.150.0050.00218.57
8.1.140.0060.00317.50
8.1.130.0030.00317.80
8.1.120.0040.00417.41
8.1.110.0000.00717.42
8.1.100.0050.00217.51
8.1.90.0040.00417.47
8.1.80.0030.00317.47
8.1.70.0000.00717.38
8.1.60.0000.00817.63
8.1.50.0000.00717.49
8.1.40.0030.00517.57
8.1.30.0000.00817.53
8.1.20.0000.00717.71
8.1.10.0030.00617.59
8.1.00.0060.00617.54
8.0.300.0040.00418.77
8.0.290.0070.00017.05
8.0.280.0000.00718.32
8.0.270.0070.00017.30
8.0.260.0070.00016.80
8.0.250.0050.00217.05
8.0.240.0000.00717.05
8.0.230.0030.00316.91
8.0.220.0040.00416.84
8.0.210.0030.00516.99
8.0.200.0030.00316.91
8.0.190.0040.00417.00
8.0.180.0050.00317.00
8.0.170.0000.00816.93
8.0.160.0040.00416.95
8.0.150.0050.00216.84
8.0.140.0000.00716.82
8.0.130.0060.00013.39
8.0.120.0000.00716.84
8.0.110.0040.00416.86
8.0.100.0060.00316.94
8.0.90.0030.00516.80
8.0.80.0070.00716.92
8.0.70.0050.00217.02
8.0.60.0040.00416.84
8.0.50.0000.00717.05
8.0.30.0130.00717.13
8.0.20.0080.01617.40
8.0.10.0000.00716.95
8.0.00.0100.01216.63
7.4.330.0030.00315.04
7.4.320.0000.00716.54
7.4.300.0040.00416.57
7.4.290.0070.00016.46
7.4.280.0030.00316.59
7.4.270.0000.00716.50
7.4.260.0040.00416.60
7.4.250.0000.00716.43
7.4.240.0030.00316.57
7.4.230.0040.00416.64
7.4.220.0090.01816.61
7.4.210.0080.00916.53
7.4.200.0030.00316.50
7.4.190.0040.00416.38
7.4.160.0130.00316.58
7.4.150.0070.01017.40
7.4.140.0090.01017.86
7.4.130.0110.00816.59
7.4.120.0110.00716.53
7.4.110.0070.01016.59
7.4.100.0070.01416.49
7.4.90.0170.00516.58
7.4.80.0120.00619.39
7.4.70.0060.01016.53
7.4.60.0060.01216.39
7.4.50.0060.00016.60
7.4.40.0030.01322.77
7.4.30.0130.00316.59
7.4.10.0030.01315.07
7.4.00.0070.01214.91
7.3.330.0030.00313.25
7.3.320.0000.00713.39
7.3.310.0000.00616.36
7.3.300.0040.00416.29
7.3.290.0080.01216.36
7.3.280.0050.01216.39
7.3.270.0170.00317.40
7.3.260.0080.00816.50
7.3.250.0120.00816.45
7.3.240.0100.00716.69
7.3.230.0140.00316.39
7.3.210.0080.00816.54
7.3.200.0120.00619.39
7.3.190.0110.00616.49
7.3.180.0120.00616.45
7.3.170.0100.00716.57
7.3.160.0100.00716.57
7.3.130.0070.01114.96
7.3.120.0060.00814.93
7.3.110.0070.01014.93
7.3.100.0070.00714.88
7.3.90.0090.00614.87
7.3.80.0070.00714.95
7.3.70.0100.00314.88
7.3.60.0070.00314.63
7.3.50.0070.00414.90
7.3.40.0100.00314.87
7.3.30.0070.00714.89
7.3.20.0000.00916.53
7.3.10.0060.00616.82
7.3.00.0000.01116.82
7.2.330.0170.00716.55
7.2.320.0090.00916.71
7.2.310.0140.00416.73
7.2.300.0120.00616.95
7.2.290.0070.01016.65
7.2.260.0030.01615.21
7.2.250.0030.01614.97
7.2.240.0040.01414.82
7.2.230.0090.00915.02
7.2.220.0120.00614.86
7.2.210.0030.01015.17
7.2.200.0070.01015.02
7.2.190.0030.01014.86
7.2.180.0040.00714.85
7.2.170.0070.00714.91
7.2.160.0000.00914.84
7.2.150.0030.01016.90
7.2.140.0060.00316.71
7.2.130.0140.00017.06
7.2.120.0030.01116.73
7.2.110.0080.00316.72
7.2.100.0020.01116.84
7.2.90.0010.01316.70
7.2.80.0090.00516.80
7.2.70.0080.00416.90
7.2.60.0070.00916.93
7.2.50.0030.01016.99
7.2.40.0040.01116.97
7.2.30.0070.00816.78
7.2.20.0070.00716.90
7.2.10.0030.00816.90
7.2.00.0080.01017.60
7.1.330.0100.01015.98
7.1.320.0030.01315.96
7.1.310.0030.01015.68
7.1.300.0060.00615.57
7.1.290.0030.01015.60
7.1.280.0000.00815.69
7.1.270.0030.01015.58
7.1.260.0000.00915.84
7.1.250.0110.00415.72
7.1.240.0030.00815.77
7.1.230.0050.01015.79
7.1.220.0070.00615.81
7.1.210.0050.01015.73
7.1.200.0090.00515.73
7.1.190.0030.01215.85
7.1.180.0110.00515.81
7.1.170.0040.00915.68
7.1.160.0050.01015.73
7.1.150.0060.00815.85
7.1.140.0060.00715.87
7.1.130.0050.01015.79
7.1.120.0060.00515.81
7.1.110.0060.00615.71
7.1.100.0030.00815.67
7.1.90.0040.00915.76
7.1.80.0040.00615.67
7.1.70.0070.00616.24
7.1.60.0040.00816.31
7.1.50.0090.00716.11
7.1.40.0080.00315.68
7.1.30.0070.00615.47
7.1.20.0080.00515.86
7.1.10.0050.00815.71
7.1.00.0070.02717.95
7.0.330.0040.00415.28
7.0.320.0090.00315.46
7.0.310.0030.01015.38
7.0.300.0060.00815.21
7.0.290.0050.01015.36
7.0.280.0040.01015.47
7.0.270.0030.00915.38
7.0.260.0070.00515.32
7.0.250.0070.00415.23
7.0.240.0050.00715.44
7.0.230.0070.00415.48
7.0.220.0030.01015.29
7.0.210.0060.00815.39
7.0.200.0070.00615.77
7.0.190.0050.00515.46
7.0.180.0090.00315.31
7.0.170.0050.00715.41
7.0.160.0060.01015.42
7.0.150.0090.00315.53
7.0.140.0040.02917.73
7.0.130.0060.00715.44
7.0.120.0080.00615.27
7.0.110.0120.00315.46
7.0.100.0080.02417.00
7.0.90.0080.03216.85
7.0.80.0070.02616.92
7.0.70.0100.01816.88
7.0.60.0090.01916.93
7.0.50.0040.01916.99
7.0.40.0060.01815.61
7.0.30.0090.01615.64
7.0.20.0030.01815.53
7.0.10.0030.01815.62
7.0.00.0070.01515.69
5.6.400.0000.01714.40
5.6.390.0060.00714.66
5.6.380.0020.00914.51
5.6.370.0090.00614.40
5.6.360.0030.00914.59
5.6.350.0070.00914.26
5.6.340.0040.00814.21
5.6.330.0040.00914.27
5.6.320.0060.01014.38
5.6.310.0050.00814.39
5.6.300.0020.01214.16
5.6.290.0070.00714.59
5.6.280.0040.02916.56
5.6.270.0040.00914.48
5.6.260.0100.00314.36
5.6.250.0100.02916.40
5.6.240.0020.03216.42
5.6.230.0080.01816.49
5.6.220.0080.01816.38
5.6.210.0060.01816.55
5.6.200.0050.01816.56
5.6.190.0030.02116.52
5.6.180.0090.01416.52
5.6.170.0090.01816.49
5.6.160.0030.01916.48
5.6.150.0060.01816.51
5.6.140.0030.01816.59
5.6.130.0050.02116.68
5.6.120.0050.02016.68
5.6.110.0070.01916.69
5.6.100.0070.01816.60
5.6.90.0060.01816.63
5.6.80.0050.02116.31
5.6.70.0020.02116.34
5.6.60.0050.01616.29
5.6.50.0060.01716.31
5.6.40.0060.03016.28
5.6.30.0090.01416.15
5.6.20.0050.02716.28
5.6.10.0030.01816.22
5.6.00.0070.02016.35
5.5.380.0100.02615.32
5.5.370.0080.02915.33
5.5.360.0060.02715.42
5.5.350.0060.01715.26
5.5.340.0090.01615.24
5.5.330.0020.02015.34
5.5.320.0040.01815.34
5.5.310.0080.02615.47
5.5.300.0050.01815.49
5.5.290.0040.02515.29
5.5.280.0030.02615.47
5.5.270.0020.02115.50
5.5.260.0060.01915.37
5.5.250.0080.01815.46
5.5.240.0080.01515.17
5.5.230.0020.02115.29
5.5.220.0030.02315.10
5.5.210.0060.02215.12
5.5.200.0030.02015.12
5.5.190.0000.02315.25
5.5.180.0050.02215.11
5.5.170.0060.00614.31
5.5.160.0060.01815.27
5.5.150.0030.01915.12
5.5.140.0040.02415.23
5.5.130.0050.03215.07
5.5.120.0050.03215.24
5.5.110.0060.01815.35
5.5.100.0090.02315.10
5.5.90.0060.02915.17
5.5.80.0080.02515.12
5.5.70.0080.02715.17
5.5.60.0070.03015.03
5.5.50.0060.03315.17
5.5.40.0040.02615.13
5.5.30.0060.02115.17
5.5.20.0040.02915.07
5.5.10.0060.02915.10
5.5.00.0010.03315.13
5.4.450.0010.01914.49
5.4.440.0060.01514.48
5.4.430.0050.01514.47
5.4.420.0050.01514.47
5.4.410.0050.02414.45
5.4.400.0070.01314.37
5.4.390.0050.01614.32
5.4.380.0040.01414.32
5.4.370.0060.01314.37
5.4.360.0020.01814.36
5.4.350.0100.01014.37
5.4.340.0070.01514.31
5.4.330.0040.00611.96
5.4.320.0070.02114.35
5.4.310.0010.01714.35
5.4.300.0030.01614.37
5.4.290.0040.01714.32
5.4.280.0050.03014.33
5.4.270.0030.02714.34
5.4.260.0060.02614.31
5.4.250.0030.03014.30
5.4.240.0040.01814.36
5.4.230.0020.02814.34
5.4.220.0050.02714.37
5.4.210.0030.02614.32
5.4.200.0030.03214.33
5.4.190.0020.03314.31
5.4.180.0060.02614.28
5.4.170.0040.02514.38
5.4.160.0020.02014.31
5.4.150.0060.03014.31
5.4.140.0010.02713.48
5.4.130.0050.02513.47
5.4.120.0050.02913.47
5.4.110.0080.02613.43
5.4.100.0050.01813.47
5.4.90.0080.02513.48
5.4.80.0040.02713.47
5.4.70.0080.02513.49
5.4.60.0050.02813.44
5.4.50.0080.02413.47
5.4.40.0040.03213.42
5.4.30.0010.02213.42
5.4.20.0030.02813.44
5.4.10.0020.02713.39
5.4.00.0020.02613.23
5.3.290.0010.01612.84
5.3.280.0050.02612.84
5.3.270.0050.02812.84
5.3.260.0080.02012.83
5.3.250.0010.02612.85
5.3.240.0060.03012.87
5.3.230.0090.02412.89
5.3.220.0060.01712.85
5.3.210.0080.02312.85
5.3.200.0020.02912.83
5.3.190.0080.02712.85
5.3.180.0070.02712.84
5.3.170.0040.02512.87
5.3.160.0050.02812.84
5.3.150.0090.02212.84
5.3.140.0020.03012.86
5.3.130.0020.02112.85
5.3.120.0010.02912.82
5.3.110.0020.02212.82
5.3.100.0060.02612.67
5.3.90.0060.01512.66
5.3.80.0020.03112.64
5.3.70.0060.02412.69
5.3.60.0040.02912.66
5.3.50.0010.03112.60
5.3.40.0080.02412.66
5.3.30.0060.03012.64
5.3.20.0060.02312.56
5.3.10.0040.02612.53
5.3.00.0040.02912.53
5.2.170.0010.03612.38
5.2.160.0050.03212.38
5.2.150.0030.03312.38
5.2.140.0070.03012.38
5.2.130.0030.03512.38
5.2.120.0040.03212.38
5.2.110.0020.03312.38
5.2.100.0070.02712.38
5.2.90.0030.03312.38
5.2.80.0030.03412.38
5.2.70.0050.03112.38
5.2.60.0080.03012.38
5.2.50.0070.03212.38
5.2.40.0050.03412.38
5.2.30.0030.02712.38
5.2.20.0030.03212.38
5.2.10.0050.03012.38
5.2.00.0070.03012.38
5.1.60.0020.02812.38
5.1.50.0040.02512.38
5.1.40.0070.01912.38
5.1.30.0080.02512.38
5.1.20.0070.02612.38
5.1.10.0030.02812.38
5.1.00.0070.02812.38
5.0.50.0050.02212.38
5.0.40.0030.02312.38
5.0.30.0020.03412.38
5.0.20.0000.01912.38
5.0.10.0030.02012.38
5.0.00.0040.02712.38
4.4.90.0000.02112.38
4.4.80.0030.02012.38
4.4.70.0020.01812.38
4.4.60.0030.01812.38
4.4.50.0000.02012.38
4.4.40.0010.02912.38
4.4.30.0030.01712.38
4.4.20.0000.01312.38
4.4.10.0000.01812.38
4.4.00.0020.03012.38
4.3.110.0030.01812.38
4.3.100.0030.01512.38
4.3.90.0000.01412.38
4.3.80.0030.01512.38
4.3.70.0070.01512.38
4.3.60.0030.01212.38
4.3.50.0030.01112.38
4.3.40.0020.03012.38
4.3.30.0020.01612.38
4.3.20.0000.02312.38
4.3.10.0020.00812.38
4.3.00.0030.02012.38

preferences:
46.95 ms | 400 KiB | 5 Q