3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ExHandler { public static function handle(Exception $e) { $label = 'Uncaught'; foreach(self::generate($e) as $cur) { printf("%s %s: %s\nStack Trace:\n%s\n\n", $label, get_class($cur), $cur->getMessage(), preg_replace('/^/m', ' ', $cur->getTraceAsString()) ); $label = 'Next'; } printf("Thrown in %s on line %d\n", $e->getFile(), $e->getLine()); printf("Custom shit over\n"); set_exception_handler(null); throw $e; } protected static function generate(Exception $e) { $prev = $e->getPrevious(); if( ! is_null($prev) ) { foreach( self::generate($prev) as $cur ) { yield $cur; } } yield $e; } } class Foo { public function bork() { $first = new Exception('I happened first!'); $second = new Exception('I happened second!', 0, $first); throw new Exception('fission mailed', 0, $second); } } set_exception_handler(['ExHandler', 'handle']); (new Foo())->bork(); /* Fatal error: Uncaught Exception: I happened earlier! in /in/F4B7q:5 Stack trace: #0 /in/F4B7q(10): Foo->bork() #1 {main} Next Exception: fission mailed in /in/F4B7q:6 Stack trace: #0 /in/F4B7q(10): Foo->bork() #1 {main} thrown in /in/F4B7q on line 6 */

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.70.0100.01018.56
8.3.60.0080.00818.52
8.3.50.0090.01216.68
8.3.40.0160.00319.05
8.3.30.0100.01018.96
8.3.20.0080.00019.14
8.3.10.0040.00423.42
8.3.00.0080.00020.61
8.2.190.0040.01118.59
8.2.180.0120.00416.88
8.2.170.0090.00622.96
8.2.160.0070.00721.02
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0080.00319.38
8.2.120.0030.00526.35
8.2.110.0040.00419.30
8.2.100.0130.00318.03
8.2.90.0040.00417.87
8.2.80.0000.00818.05
8.2.70.0060.00318.05
8.2.60.0050.00318.22
8.2.50.0030.00518.10
8.2.40.0000.00819.47
8.2.30.0000.00820.55
8.2.20.0000.00818.24
8.2.10.0040.00418.42
8.2.00.0000.00719.52
8.1.280.0000.01425.92
8.1.270.0080.00023.99
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00319.22
8.1.230.0060.00618.96
8.1.220.0050.00317.89
8.1.210.0040.00418.77
8.1.200.0090.00017.50
8.1.190.0030.00617.25
8.1.180.0000.00818.10
8.1.170.0040.00418.92
8.1.160.0040.00418.97
8.1.150.0050.00218.94
8.1.140.0030.00520.82
8.1.130.0000.00717.64
8.1.120.0070.00017.70
8.1.110.0000.00717.64
8.1.100.0000.00717.68
8.1.90.0000.00817.54
8.1.80.0040.00417.70
8.1.70.0080.00317.66
8.1.60.0090.00317.76
8.1.50.0000.00817.72
8.1.40.0040.00417.68
8.1.30.0040.00417.86
8.1.20.0040.00417.76
8.1.10.0030.00617.63
8.1.00.0050.00317.68
8.0.300.0080.00019.02
8.0.290.0050.00216.88
8.0.280.0000.00718.58
8.0.270.0000.00817.23
8.0.260.0070.00017.07
8.0.250.0000.00717.24
8.0.240.0000.00717.29
8.0.230.0030.00317.26
8.0.220.0000.00717.14
8.0.210.0070.00017.25
8.0.200.0030.00317.31
8.0.190.0000.00817.22
8.0.180.0000.00817.25
8.0.170.0030.00617.27
8.0.160.0030.00617.18
8.0.150.0000.00717.20
8.0.140.0080.00017.16
8.0.130.0030.00313.68
8.0.120.0020.00517.21
8.0.110.0040.00417.24
8.0.100.0040.00417.18
8.0.90.0050.00317.15
8.0.80.0010.01917.20
8.0.70.0040.00417.23
8.0.60.0050.00317.11
8.0.50.0000.00717.27
8.0.30.0150.01417.41
8.0.20.0090.01117.40
8.0.10.0020.00517.17
8.0.00.0090.01117.15
7.4.330.0020.00215.55
7.4.320.0030.00316.68
7.4.300.0070.00016.75
7.4.290.0000.00716.70
7.4.280.0000.00816.86
7.4.270.0030.00316.62
7.4.260.0030.00616.82
7.4.250.0060.00316.87
7.4.240.0040.00416.68
7.4.230.0000.00716.74
7.4.220.0040.00416.94
7.4.210.0080.01016.74
7.4.200.0040.00416.83
7.4.160.0100.00716.79
7.4.140.0140.00717.86
7.4.130.0070.01616.68
7.4.120.0100.01216.82
7.4.110.0170.00016.66
7.4.100.0150.00416.85
7.4.90.0090.00916.73
7.4.80.0170.00019.39
7.4.70.0100.00716.87
7.4.60.0000.01716.84
7.4.50.0040.01116.72
7.4.40.0070.01016.77
7.4.00.0060.00915.04
7.3.330.0000.00513.62
7.3.320.0030.00313.65
7.3.310.0030.00316.56
7.3.300.0050.00216.59
7.3.290.0070.00016.54
7.3.280.0000.01616.68
7.3.260.0100.00716.78
7.3.240.0060.01216.62
7.3.230.0120.00616.61
7.3.210.0090.00916.69
7.3.200.0040.01416.68
7.3.190.0070.01316.78
7.3.180.0070.01016.61
7.3.170.0030.01316.74
7.3.160.0140.00816.88
7.3.120.0070.01014.80
7.3.110.0000.01515.13
7.3.100.0060.01014.98
7.3.90.0070.00714.93
7.3.80.0040.01115.02
7.3.70.0000.01514.84
7.3.60.0100.00715.10
7.3.50.0030.00914.64
7.3.40.0040.01114.81
7.3.30.0080.00615.08
7.3.20.0070.00716.82
7.3.10.0100.00616.87
7.3.00.0110.00716.95
7.2.330.0150.00916.89
7.2.320.0120.00616.93
7.2.310.0090.00916.72
7.2.300.0110.00616.74
7.2.290.0090.00916.93
7.2.240.0100.00315.41
7.2.230.0100.00715.38
7.2.220.0000.01614.96
7.2.210.0080.00815.31
7.2.200.0040.00715.23
7.2.190.0030.00915.21
7.2.180.0040.00815.30
7.2.170.0060.00315.16
7.2.160.0040.00715.20
7.2.150.0150.00417.16
7.2.140.0080.00417.10
7.2.130.0120.00017.09
7.2.120.0120.00316.80
7.2.110.0030.01017.21
7.2.100.0070.01017.13
7.2.90.0170.00716.06
7.2.80.0090.00715.84
7.2.70.0070.01016.23
7.2.60.0120.00716.19
7.2.50.0120.00516.06
7.2.40.0120.00316.11
7.2.30.0090.00616.30
7.2.20.0070.00816.13
7.2.10.0080.01016.05
7.2.00.0090.00516.17
7.1.330.0040.01215.99
7.1.320.0130.00016.00
7.1.310.0030.01315.76
7.1.300.0070.00715.89
7.1.290.0060.00616.00
7.1.280.0030.01015.58
7.1.270.0070.01016.04
7.1.260.0000.01516.05
7.1.250.0090.00615.95
7.1.210.0100.00514.02
7.1.200.0080.00614.25
7.1.190.0160.00014.05
7.1.180.0040.01414.10
7.1.170.0110.00214.11
7.1.160.0380.00813.93
7.1.150.0140.00014.18
7.1.140.0750.00314.16
7.1.130.0120.00913.98
7.1.120.0240.00614.08
7.1.110.3000.00714.19
7.1.100.0230.00313.90
7.1.90.0150.00414.00
7.1.80.0120.00913.95
7.1.70.0100.01014.25
7.1.60.0340.01431.94
7.1.50.0480.00332.23
7.1.40.1100.00332.21
7.1.30.1190.00632.12
7.1.20.1140.01432.02
7.1.10.2880.01013.99
7.1.00.2240.00714.20

preferences:
66.57 ms | 401 KiB | 5 Q