3v4l.org

run code in 300+ PHP versions simultaneously
<?php function exceptionHandler($exception) { // these are our templates $traceline = "#%s %s(%s): %s(%s)"; $msg = "PHP Fatal error: Uncaught exception '%s' with message '%s' in %s:%s\nStack trace:\n%s\n thrown in %s on line %s"; // alter your trace as you please, here $trace = $exception->getTrace(); foreach ($trace as $key => $stackPoint) { // I'm converting arguments to their type // (prevents passwords from ever getting logged as anything other than 'string') $trace[$key]['args'] = array_map('gettype', $trace[$key]['args']); } // build your tracelines $result = array(); foreach ($trace as $key => $stackPoint) { $result[] = sprintf( $traceline, $key, $stackPoint['file'], $stackPoint['line'], $stackPoint['function'], implode(', ', $stackPoint['args']) ); } // trace always ends with {main} $result[] = '#' . ++$key . ' {main}'; // write tracelines into main template $msg = sprintf( $msg, get_class($exception), $exception->getMessage(), $exception->getFile(), $exception->getLine(), implode("\n", $result), $exception->getFile(), $exception->getLine() ); // log or echo as you please error_log($msg); } set_exception_handler("exceptionHandler"); a(); function a() { throw new Exception("Just invoking the exception handler"); }

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.0070.00716.85
8.3.50.0140.00521.93
8.3.40.0070.01018.84
8.3.30.0140.00019.04
8.3.20.0070.00020.32
8.3.10.0040.00423.63
8.3.00.0030.00522.52
8.2.180.0120.00316.88
8.2.170.0100.00322.96
8.2.160.0070.00722.08
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00022.08
8.2.110.0060.00321.93
8.2.100.0060.00617.84
8.2.90.0030.00619.14
8.2.80.0080.00018.05
8.2.70.0060.00317.63
8.2.60.0050.00317.90
8.2.50.0040.00418.07
8.2.40.0040.00419.46
8.2.30.0040.00418.15
8.2.20.0000.00817.86
8.2.10.0080.00017.80
8.2.00.0040.00417.77
8.1.280.0140.00725.92
8.1.270.0030.00623.71
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00623.91
8.1.230.0080.00319.00
8.1.220.0040.00417.76
8.1.210.0050.00318.77
8.1.200.0060.00317.36
8.1.190.0090.00017.41
8.1.180.0080.00018.10
8.1.170.0030.00618.71
8.1.160.0040.00422.16
8.1.150.0000.00718.63
8.1.140.0050.00317.47
8.1.130.0030.00317.86
8.1.120.0060.00317.50
8.1.110.0040.00417.50
8.1.100.0000.00717.52
8.1.90.0040.00417.39
8.1.80.0030.00317.48
8.1.70.0000.00717.42
8.1.60.0060.00317.64
8.1.50.0000.00917.56
8.1.40.0000.00917.58
8.1.30.0000.00817.64
8.1.20.0040.00417.66
8.1.10.0000.00817.62
8.1.00.0060.00317.57
8.0.300.0000.00818.77
8.0.290.0070.00017.05
8.0.280.0070.00018.48
8.0.270.0030.00317.30
8.0.260.0030.00316.98
8.0.250.0030.00317.06
8.0.240.0040.00717.08
8.0.230.0000.00716.96
8.0.220.0070.00016.86
8.0.210.0000.00716.89
8.0.200.0030.00316.93
8.0.190.0040.00416.94
8.0.180.0040.00417.05
8.0.170.0030.00617.04
8.0.160.0070.00017.03
8.0.150.0000.00817.04
8.0.140.0000.00717.00
8.0.130.0030.00313.45
8.0.120.0040.00416.86
8.0.110.0040.00416.92
8.0.100.0050.00216.79
8.0.90.0030.00516.98
8.0.80.0040.01717.02
8.0.70.0040.00416.94
8.0.60.0040.00416.95
8.0.50.0000.00916.89
8.0.30.0130.00517.23
8.0.20.0130.00617.40
8.0.10.0000.00716.99
8.0.00.0090.00916.73
7.4.330.0030.00315.32
7.4.320.0030.00316.55
7.4.300.0000.00616.44
7.4.290.0000.00716.56
7.4.280.0080.00016.62
7.4.270.0000.00716.47
7.4.260.0050.00316.57
7.4.250.0040.00416.48
7.4.240.0050.00216.65
7.4.230.0070.00016.64
7.4.220.0090.00916.60
7.4.210.0120.00716.71
7.4.200.0000.00716.54
7.4.190.0000.00716.51
7.4.160.0120.00616.61
7.4.150.0100.00717.40
7.4.140.0080.01017.86
7.4.130.0100.00716.72
7.4.120.0120.00716.63
7.4.110.0000.01816.55
7.4.100.0090.01216.70
7.4.90.0070.01016.71
7.4.80.0090.00919.39
7.4.70.0070.01016.59
7.4.60.0080.00816.51
7.4.50.0040.00416.51
7.4.40.0060.00922.77
7.4.30.0040.01216.48
7.4.00.0030.01314.88
7.3.330.0060.00013.39
7.3.320.0050.00013.31
7.3.310.0030.00316.48
7.3.300.0000.00716.46
7.3.290.0060.00916.38
7.3.280.0060.01016.49
7.3.270.0150.00317.40
7.3.260.0060.01216.60
7.3.250.0090.00916.54
7.3.240.0090.00916.63
7.3.230.0070.01316.73
7.3.210.0130.00316.79
7.3.200.0030.01316.37
7.3.190.0120.01316.45
7.3.180.0060.01016.52
7.3.170.0070.00716.61
7.3.160.0200.00316.64
7.3.120.0040.01215.23
7.3.10.0070.01316.38
7.3.00.0180.00416.29
7.2.330.0070.01116.79
7.2.320.0070.01016.59
7.2.310.0090.01316.79
7.2.300.0100.01016.84
7.2.290.0060.01316.61
7.2.130.0110.00816.21
7.2.120.0100.01016.87
7.2.110.0190.00616.68
7.2.100.0080.01116.33
7.2.90.0070.01416.48
7.2.80.0100.01016.62
7.2.70.0120.01216.63
7.2.60.0100.01416.62
7.2.50.0150.01116.39
7.2.40.0120.01816.80
7.2.30.0220.00316.36
7.2.20.0180.01216.42
7.2.10.0170.01116.74
7.2.00.0120.01516.71
7.1.250.0080.00815.62
7.1.100.0000.01418.30
7.1.70.0060.00617.30
7.1.60.0040.00817.32
7.1.50.0040.02217.07
7.1.00.0030.08022.41
7.0.200.0030.01316.97
7.0.140.0030.07022.00
7.0.70.0170.07021.70
7.0.60.0030.06021.74
7.0.50.0070.06722.18
7.0.40.0070.06720.03
7.0.30.0070.04320.13
7.0.20.0100.03720.18
7.0.10.0070.04020.00
7.0.00.0030.08320.04
5.6.280.0070.06320.87
5.6.220.0100.07720.63
5.6.210.0070.08020.68
5.6.200.0030.09321.10
5.6.190.0100.05020.94
5.6.180.0100.07321.12
5.6.170.0070.04020.94
5.6.160.0030.06021.06
5.6.150.0100.07321.05
5.6.140.0100.03721.09
5.6.130.0070.04021.15
5.6.120.0070.07020.96
5.6.110.0000.05321.05
5.6.100.0070.05320.96
5.6.90.0070.04321.13
5.6.80.0070.03720.50
5.6.70.0070.04720.40
5.6.60.0070.04320.49
5.6.50.0000.03720.51
5.6.40.0030.03320.50
5.6.30.0070.03020.38
5.6.20.0000.04020.33
5.6.10.0030.03320.41
5.6.00.0000.04020.34
5.5.360.0100.08320.38
5.5.350.0130.07720.36
5.5.340.0030.09020.95
5.5.330.0030.08020.75
5.5.320.0030.04320.91
5.5.310.0070.04320.85
5.5.300.0030.08720.66
5.5.290.0030.04320.89
5.5.280.0100.05320.75
5.5.270.0030.04320.74
5.5.260.0130.06020.84
5.5.250.0030.08020.56
5.5.240.0000.04320.26
5.5.230.0130.03020.26
5.5.220.0030.04020.28
5.5.210.0030.03720.08
5.5.200.0000.04020.29
5.5.190.0030.03320.01
5.5.180.0030.03720.16
5.5.160.0000.04320.25
5.5.150.0000.03320.27
5.5.140.0070.03320.18
5.5.130.0070.03020.20
5.5.120.0030.04020.25
5.5.110.0000.04020.24
5.5.100.0030.04720.06
5.5.90.0100.06720.16
5.5.80.0030.03720.17
5.5.70.0000.05720.05
5.5.60.0130.06320.10
5.5.50.0030.08019.98
5.5.40.0070.07020.07
5.5.30.0100.06720.15
5.5.20.0070.07720.16
5.5.10.0030.07720.08
5.5.00.0100.08020.13
5.4.450.0070.03719.36
5.4.440.0130.04719.51
5.4.430.0030.04319.55
5.4.420.0070.07319.44
5.4.410.0130.03019.24
5.4.400.0030.04319.14
5.4.390.0030.04019.17
5.4.380.0070.03719.13
5.4.370.0000.04019.23
5.4.360.0030.04719.13
5.4.350.0000.04719.16
5.4.340.0030.03719.04
5.4.320.0000.04018.85
5.4.310.0000.04319.16
5.4.300.0030.03718.86
5.4.290.0030.03018.94
5.4.280.0000.03319.18
5.4.270.0030.07019.18
5.4.260.0100.07019.08
5.4.250.0030.03718.95
5.4.240.0030.05018.84
5.4.230.0000.07719.02
5.4.220.0030.04719.02
5.4.210.0030.07319.13
5.4.200.0000.06719.08
5.4.190.0030.07718.84
5.4.180.0000.08318.88
5.4.170.0030.08718.93
5.4.160.0030.08019.02
5.4.150.0000.08719.19
5.4.140.0070.07716.25
5.4.130.0000.05316.46
5.4.120.0030.07716.50
5.4.110.0030.05016.54
5.4.100.0070.04716.49
5.4.90.0030.03716.54
5.4.80.0030.04716.52
5.4.70.0030.05316.40
5.4.60.0030.07316.37
5.4.50.0100.05316.46
5.4.40.0030.08016.53
5.4.30.0100.07016.38
5.4.20.0100.07016.30
5.4.10.0030.07016.36
5.4.00.0070.07015.88
5.3.290.0030.03714.75
5.3.280.0100.06314.67
5.3.270.0070.06014.62
5.3.260.0000.08014.55
5.3.250.0030.08014.56
5.3.240.0000.08014.69
5.3.230.0100.07314.64
5.3.220.0030.08014.51
5.3.210.0000.06314.51
5.3.200.0070.05714.71
5.3.190.0070.07014.70
5.3.180.0030.07314.67
5.3.170.0030.05314.52
5.3.160.0100.07314.63
5.3.150.0170.06014.73
5.3.140.0100.05314.61
5.3.130.0030.07714.66
5.3.120.0070.06314.50
5.3.110.0030.08714.56
5.3.100.0000.06014.04
5.3.90.0170.06314.13
5.3.80.0100.06714.09
5.3.70.0070.07013.93
5.3.60.0030.07713.92
5.3.50.0100.07014.09
5.3.40.0000.08014.03
5.3.30.0100.06714.00
5.3.20.0000.05013.77
5.3.10.0000.04313.60
5.3.00.0100.04713.72
5.2.170.0030.06311.49
5.2.160.0000.04311.49
5.2.150.0130.05311.49
5.2.140.0070.05311.49
5.2.130.0030.06311.49
5.2.120.0000.06311.49
5.2.110.0000.06311.49
5.2.100.0070.05311.49
5.2.90.0000.06311.49
5.2.80.0030.06311.49
5.2.70.0100.05311.49
5.2.60.0070.06311.49
5.2.50.0070.05011.49
5.2.40.0030.05311.49
5.2.30.0070.05711.49
5.2.20.0130.03711.49
5.2.10.0070.05311.49
5.2.00.0070.05311.49
5.1.60.0000.04711.49
5.1.50.0070.05011.49
5.1.40.0000.04311.49
5.1.30.0030.06011.49
5.1.20.0070.05011.49
5.1.10.0030.05311.49
5.1.00.0070.05311.49
5.0.50.0030.04311.49
5.0.40.0070.03311.49
5.0.30.0000.05311.49
5.0.20.0030.04311.49
5.0.10.0000.03711.49
5.0.00.0000.06711.49
4.4.90.0000.04011.49
4.4.80.0000.03311.49
4.4.70.0000.03711.49
4.4.60.0000.03311.49
4.4.50.0000.03711.49
4.4.40.0000.04311.49
4.4.30.0000.02711.49
4.4.20.0030.02311.49
4.4.10.0000.03711.49
4.4.00.0000.05011.49
4.3.110.0030.03011.49
4.3.100.0070.03011.49
4.3.90.0000.03011.49
4.3.80.0030.04311.49
4.3.70.0030.03011.49
4.3.60.0000.03311.49
4.3.50.0100.02011.49
4.3.40.0000.04311.49
4.3.30.0030.02311.49
4.3.20.0000.03711.49
4.3.10.0070.01711.49
4.3.00.0000.02711.49

preferences:
50.82 ms | 401 KiB | 5 Q