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(); } // Forward all throwed Exceptions 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"; } }; } function do_something_before() { return function() { echo "Before!\n"; }; } $foo = decorate(decorate("foo", "catch_all_exceptions"), "do_something_before"); $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.0110.00418.55
8.3.50.0100.01022.10
8.3.40.0030.01218.84
8.3.30.0150.00018.85
8.3.20.0050.00220.39
8.3.10.0000.00823.66
8.3.00.0070.00020.71
8.2.180.0110.00316.75
8.2.170.0110.01122.96
8.2.160.0100.00322.09
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00422.20
8.2.110.0000.00922.07
8.2.100.0060.00617.78
8.2.90.0050.00319.05
8.2.80.0040.00418.04
8.2.70.0060.00317.75
8.2.60.0000.00817.80
8.2.50.0040.00418.07
8.2.40.0000.00819.33
8.2.30.0050.00317.98
8.2.20.0040.00417.67
8.2.10.0080.00017.83
8.2.00.0030.00617.66
8.1.280.0180.00325.92
8.1.270.0000.00823.96
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00623.89
8.1.230.0050.00519.00
8.1.220.0090.00017.74
8.1.210.0050.00318.77
8.1.200.0060.00317.35
8.1.190.0000.00817.53
8.1.180.0060.00318.10
8.1.170.0040.00418.43
8.1.160.0000.00822.02
8.1.150.0070.00018.59
8.1.140.0000.00817.42
8.1.130.0000.00717.69
8.1.120.0070.00317.51
8.1.110.0000.00717.36
8.1.100.0070.00017.45
8.1.90.0040.00417.50
8.1.80.0030.00317.50
8.1.70.0030.00317.44
8.1.60.0000.00817.48
8.1.50.0030.00517.49
8.1.40.0000.00717.43
8.1.30.0060.00317.68
8.1.20.0050.00217.73
8.1.10.0040.00417.44
8.1.00.0050.00317.45
8.0.300.0040.00418.77
8.0.290.0000.00717.18
8.0.280.0050.00218.40
8.0.270.0000.00817.18
8.0.260.0000.00816.86
8.0.250.0000.00717.05
8.0.240.0000.00916.94
8.0.230.0050.00317.09
8.0.220.0080.00016.98
8.0.210.0080.00016.86
8.0.200.0030.00316.89
8.0.190.0040.00416.96
8.0.180.0040.00416.95
8.0.170.0000.00716.82
8.0.160.0060.00316.95
8.0.150.0000.00716.96
8.0.140.0000.00716.95
8.0.130.0030.00313.35
8.0.120.0000.00716.93
8.0.110.0000.00816.88
8.0.100.0040.00416.79
8.0.90.0050.00317.04
8.0.80.0110.00716.93
8.0.70.0040.00417.00
8.0.60.0000.00817.01
8.0.50.0040.00417.01
8.0.30.0080.01217.21
8.0.20.0130.00517.40
8.0.10.0000.00717.10
8.0.00.0080.01016.78
7.4.330.0030.00315.00
7.4.320.0050.00216.63
7.4.300.0030.00316.62
7.4.290.0000.00716.55
7.4.280.0000.00716.50
7.4.270.0000.00716.54
7.4.260.0000.00716.43
7.4.250.0000.00716.48
7.4.240.0010.00616.60
7.4.230.0030.00316.61
7.4.220.0090.00916.38
7.4.210.0070.00916.63
7.4.200.0070.00016.70
7.4.190.0000.00716.53
7.4.160.0090.00616.59
7.4.150.0140.00317.40
7.4.140.0080.01017.86
7.4.130.0060.01216.43
7.4.120.0100.00716.60
7.4.110.0160.00316.52
7.4.100.0100.00716.43
7.4.90.0140.00916.57
7.4.80.0110.00616.44
7.4.70.0150.00616.52
7.4.60.0040.01216.68
7.4.50.0000.00516.37
7.4.40.0060.00922.77
7.4.30.0040.01716.47
7.4.00.0080.00814.93
7.3.330.0030.00313.35
7.3.320.0030.00313.36
7.3.310.0070.00016.23
7.3.300.0000.00716.34
7.3.290.0050.01416.32
7.3.280.0100.00916.37
7.3.270.0090.00917.40
7.3.260.0160.00316.34
7.3.250.0100.00916.36
7.3.240.0180.00516.40
7.3.230.0030.01316.47
7.3.210.0170.00016.58
7.3.200.0100.00719.39
7.3.190.0120.00916.46
7.3.180.0090.00616.39
7.3.170.0000.01716.46
7.3.160.0060.01016.41
7.3.120.0080.00914.81
7.3.110.0060.00914.87
7.3.100.0090.00714.92
7.3.90.0080.00714.93
7.3.80.0100.00314.82
7.3.70.0040.00714.73
7.3.60.0100.00414.88
7.3.50.0060.00615.01
7.3.40.0040.00914.84
7.3.30.0040.00914.78
7.3.20.0020.00816.63
7.3.10.0050.00716.74
7.3.00.0070.00616.67
7.2.330.0040.01216.66
7.2.320.0100.00716.70
7.2.310.0100.01016.70
7.2.300.0170.00016.69
7.2.290.0120.00616.71
7.2.250.0070.01015.12
7.2.240.0070.01315.22
7.2.230.0080.00715.14
7.2.220.0050.00815.09
7.2.210.0020.01215.01
7.2.200.0050.00914.98
7.2.190.0030.00715.01
7.2.180.0030.01215.14
7.2.170.0060.01014.92
7.2.160.0060.01115.03
7.2.150.0110.00516.93
7.2.140.0070.00516.97
7.2.130.0050.01216.80
7.2.120.0020.01217.02
7.2.110.0090.00616.95
7.2.100.0070.00816.94
7.2.90.0050.01017.00
7.2.80.0030.01116.87
7.2.70.0060.00717.02
7.2.60.0060.00816.88
7.2.50.0050.00616.80
7.2.40.0100.00516.92
7.2.30.0030.01016.84
7.2.20.0020.01316.99
7.2.10.0030.01016.93
7.2.00.0060.00717.75
7.1.330.0060.01015.85
7.1.320.0030.00615.78
7.1.310.0080.00415.75
7.1.300.0040.00815.74
7.1.290.0070.00815.72
7.1.280.0060.00715.73
7.1.270.0020.01015.69
7.1.260.0060.00815.80
7.1.250.0060.00615.79
7.1.240.0030.00915.89
7.1.230.0060.00315.64
7.1.220.0060.00615.88
7.1.210.0070.00715.70
7.1.200.0050.00715.76
7.1.190.0040.01115.54
7.1.180.0040.01115.85
7.1.170.0050.00515.82
7.1.160.0030.01015.82
7.1.150.0040.00415.48
7.1.140.0070.00415.89
7.1.130.0100.00315.63
7.1.120.0070.00715.51
7.1.110.0030.01315.59
7.1.100.0060.00416.90
7.1.90.0000.01315.86
7.1.80.0000.01415.57
7.1.70.0070.00816.43
7.1.60.0090.01017.55
7.1.50.0070.01116.37
7.1.40.0060.00615.80
7.1.30.0030.00615.77
7.1.20.0120.00315.82
7.1.10.0060.00615.51
7.1.00.0050.04019.06
7.0.330.0100.00315.47
7.0.320.0050.00515.51
7.0.310.0030.01015.27
7.0.300.0050.00515.29
7.0.290.0070.00315.41
7.0.280.0060.00315.33
7.0.270.0030.01015.41
7.0.260.0070.01015.47
7.0.250.0000.00815.41
7.0.240.0040.00815.50
7.0.230.0030.00715.31
7.0.220.0070.00715.49
7.0.210.0060.00615.38
7.0.200.0030.00516.00
7.0.190.0030.01015.20
7.0.180.0090.00315.17
7.0.170.0070.00715.06
7.0.160.0070.00715.39
7.0.150.0030.01015.34
7.0.140.0070.03818.80
7.0.130.0050.00215.40
7.0.120.0040.00815.42
7.0.110.0040.04717.66
7.0.100.0100.04217.66
7.0.90.0080.04317.61
7.0.80.0030.04017.68
7.0.70.0100.04217.62
7.0.60.0050.04317.58
7.0.50.0020.05017.76
7.0.40.0030.04516.60
7.0.30.0050.03916.76
7.0.20.0060.04116.83
7.0.10.0070.04016.63
7.0.00.0100.02716.69
5.6.400.0070.00714.14
5.6.390.0030.01014.59
5.6.380.0030.01314.17
5.6.370.0080.00414.20
5.6.360.0040.01113.92
5.6.350.0030.01014.38
5.6.340.0030.00914.57
5.6.330.0100.00314.52
5.6.320.0100.00714.62
5.6.310.0040.00414.58
5.6.300.0000.01214.64
5.6.290.0060.00814.61
5.6.280.0020.04217.57
5.6.270.0030.01014.59
5.6.260.0000.01414.59
5.6.250.0060.04017.44
5.6.240.0080.04017.37
5.6.230.0040.04917.51
5.6.220.0050.04717.64
5.6.210.0080.04317.39
5.6.200.0080.02817.70
5.6.190.0050.04717.76
5.6.180.0050.04617.85
5.6.170.0070.03517.58
5.6.160.0060.04317.63
5.6.150.0020.04617.66
5.6.140.0050.04617.70
5.6.130.0050.03117.77
5.6.120.0050.04017.75
5.6.110.0070.02217.75
5.6.100.0000.02817.73
5.6.90.0050.02517.57
5.6.80.0050.02517.22
5.6.70.0070.03017.34
5.6.60.0070.03017.24
5.6.50.0020.02917.45
5.6.40.0080.03217.40
5.6.30.0020.03117.39
5.6.20.0050.02417.28
5.6.10.0050.02317.23
5.6.00.0090.02017.24
5.5.380.0100.04117.26
5.5.370.0040.04317.22
5.5.360.0100.02517.39
5.5.350.0070.04717.29
5.5.340.0080.04117.61
5.5.330.0050.04317.66
5.5.320.0120.04417.53
5.5.310.0050.04217.56
5.5.300.0050.03017.34
5.5.290.0110.03417.54
5.5.280.0050.02517.36
5.5.270.0060.02317.67
5.5.260.0020.02717.63
5.5.250.0080.02217.64
5.5.240.0080.01817.35
5.5.230.0070.02017.15
5.5.220.0070.02517.04
5.5.210.0070.02117.34
5.5.200.0050.02217.03
5.5.190.0060.02217.20
5.5.180.0020.02717.26
5.5.170.0070.00713.97
5.5.160.0060.02017.35
5.5.150.0020.03117.29
5.5.140.0070.02417.01
5.5.130.0030.02417.30
5.5.120.0020.02617.19
5.5.110.0050.02117.31
5.5.100.0050.02117.29
5.5.90.0060.01817.20
5.5.80.0100.01817.13
5.5.70.0050.03017.27
5.5.60.0010.02317.04
5.5.50.0030.02317.30
5.5.40.0050.02216.99
5.5.30.0050.04417.14
5.5.20.0040.03417.15
5.5.10.0100.01817.21
5.5.00.0020.02617.08
5.4.450.0060.03915.27
5.4.440.0080.02015.27
5.4.430.0060.02115.26
5.4.420.0020.02515.38
5.4.410.0050.02215.19
5.4.400.0020.02115.11
5.4.390.0020.02415.19
5.4.380.0070.03215.29
5.4.370.0030.02015.18
5.4.360.0040.02215.21
5.4.350.0050.01715.22
5.4.340.0080.01815.14
5.4.330.0070.00711.20
5.4.320.0050.03115.11
5.4.310.0020.02215.10
5.4.300.0000.02415.19
5.4.290.0050.01815.21
5.4.280.0030.02215.17
5.4.270.0050.02015.11
5.4.260.0020.02215.19
5.4.250.0040.02015.10
5.4.240.0050.02515.11
5.4.230.0070.02715.07
5.4.220.0030.02215.19
5.4.210.0020.02215.22
5.4.200.0090.03415.18
5.4.190.0050.02115.11
5.4.180.0020.02515.16
5.4.170.0020.02315.19
5.4.160.0030.02115.07
5.4.150.0030.03515.25
5.4.140.0060.02113.79
5.4.130.0010.03913.84
5.4.120.0080.04013.77
5.4.110.0110.03313.75
5.4.100.0050.03513.83
5.4.90.0060.03913.84
5.4.80.0080.03713.82
5.4.70.0080.03613.89
5.4.60.0050.03513.74
5.4.50.0030.04213.85
5.4.40.0080.03513.82
5.4.30.0050.03913.79
5.4.20.0040.04013.91
5.4.10.0020.04113.86
5.4.00.0090.02213.59
5.3.290.0020.02312.96
5.3.280.0050.01812.92
5.3.270.0020.03012.92
5.3.260.0020.02212.98
5.3.250.0020.02312.92
5.3.240.0000.02212.96
5.3.230.0070.04212.85
5.3.220.0050.04013.01
5.3.210.0050.02712.91
5.3.200.0070.03312.91
5.3.190.0070.03712.90
5.3.180.0070.03813.01
5.3.170.0030.04012.94
5.3.160.0070.03812.82
5.3.150.0030.02712.90
5.3.140.0080.03512.87
5.3.130.0030.04412.88
5.3.120.0100.03312.94
5.3.110.0020.04012.89
5.3.100.0050.03812.63
5.3.90.0030.03912.60
5.3.80.0000.04412.63
5.3.70.0050.03912.54
5.3.60.0030.04112.61
5.3.50.0070.03412.62
5.3.40.0020.04612.59
5.3.30.0020.03912.59
5.3.20.0030.03812.46
5.3.10.0050.04012.55
5.3.00.0030.04012.42
5.2.170.0000.03711.73
5.2.160.0030.03711.73
5.2.150.0070.06011.73
5.2.140.0130.03011.73
5.2.130.0000.06711.73
5.2.120.0000.06711.73
5.2.110.0030.06311.73
5.2.100.0070.05711.73
5.2.90.0100.05711.73
5.2.80.0100.05011.73
5.2.70.0030.06311.73
5.2.60.0030.06011.73
5.2.50.0030.06011.73
5.2.40.0070.06011.73
5.2.30.0100.05711.73
5.2.20.0100.05311.73
5.2.10.0000.06311.73
5.2.00.0030.05011.73
5.1.60.0130.04711.73
5.1.50.0030.04711.73
5.1.40.0070.05011.73
5.1.30.0000.06011.73
5.1.20.0000.05711.73
5.1.10.0070.05311.73
5.1.00.0000.06011.73
5.0.50.0070.04011.73
5.0.40.0000.04711.73
5.0.30.0000.05311.73
5.0.20.0030.03711.73
5.0.10.0100.03711.73
5.0.00.0030.06311.73
4.4.90.0000.03711.73
4.4.80.0000.03711.73
4.4.70.0000.03711.73
4.4.60.0100.02711.73
4.4.50.0000.03711.73
4.4.40.0000.05711.73
4.4.30.0000.04011.73
4.4.20.0030.03711.73
4.4.10.0000.03711.73
4.4.00.0070.04711.73
4.3.110.0030.03311.73
4.3.100.0030.03311.73
4.3.90.0000.03711.73
4.3.80.0000.05711.73
4.3.70.0000.03311.73
4.3.60.0100.02311.73
4.3.50.0000.03711.73
4.3.40.0030.05311.73
4.3.30.0030.03011.73
4.3.20.0000.03711.73
4.3.10.0030.03311.73
4.3.00.0000.02011.73

preferences:
39.73 ms | 401 KiB | 5 Q