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 Exception `%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(), implode("\n", $result), $exception->getFile(), $exception->getLine() ); // log or echo as you please print $msg; } set_exception_handler("exceptionHandler"); a("1"); function a($i) { 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.0080.01516.63
8.3.50.0200.00917.29
8.3.40.0070.00718.82
8.3.30.0030.01219.02
8.3.20.0000.00818.81
8.3.10.0000.00820.52
8.3.00.0080.00017.63
8.2.180.0140.00716.75
8.2.170.0180.00322.96
8.2.160.0040.01122.19
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.01126.16
8.2.120.0050.00319.96
8.2.110.0060.00321.02
8.2.100.0040.00818.03
8.2.90.0100.00021.09
8.2.80.0050.00318.16
8.2.70.0000.00917.63
8.2.60.0030.00517.92
8.2.50.0000.00818.07
8.2.40.0000.00718.16
8.2.30.0040.00418.15
8.2.20.0040.00417.68
8.2.10.0000.00817.71
8.2.00.0030.00617.87
8.1.280.0110.00725.92
8.1.270.0020.00523.99
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0070.00322.64
8.1.230.0070.00420.96
8.1.220.0000.00817.74
8.1.210.0030.00518.84
8.1.200.0000.00817.35
8.1.190.0040.00417.51
8.1.180.0000.00818.10
8.1.170.0080.00018.71
8.1.160.0040.00418.91
8.1.150.0030.00518.66
8.1.140.0030.00717.51
8.1.130.0030.00517.84
8.1.120.0030.00517.55
8.1.110.0040.00417.44
8.1.100.0050.00217.39
8.1.90.0070.00017.40
8.1.80.0000.00817.54
8.1.70.0000.00817.30
8.1.60.0040.00417.63
8.1.50.0050.00317.39
8.1.40.0040.00417.55
8.1.30.0050.00217.68
8.1.20.0060.00317.75
8.1.10.0040.00417.67
8.1.00.0040.00417.46
8.0.300.0000.00719.94
8.0.290.0040.00416.75
8.0.280.0040.00418.46
8.0.270.0030.00317.24
8.0.260.0000.00816.97
8.0.250.0040.00417.04
8.0.240.0030.00316.98
8.0.230.0000.00717.08
8.0.220.0040.00416.94
8.0.210.0040.00416.94
8.0.200.0030.00316.98
8.0.190.0000.00817.06
8.0.180.0030.00616.87
8.0.170.0030.00617.03
8.0.160.0000.00717.03
8.0.150.0080.00016.93
8.0.140.0070.00316.93
8.0.130.0030.00313.40
8.0.120.0070.00016.98
8.0.110.0040.00417.02
8.0.100.0040.00416.83
8.0.90.0070.00016.85
8.0.80.0090.00616.96
8.0.70.0000.00816.89
8.0.60.0040.00417.02
8.0.50.0040.00416.82
8.0.30.0120.00717.18
8.0.20.0120.00917.00
8.0.10.0030.00617.12
8.0.00.0110.01216.99
7.4.330.0020.00213.05
7.4.320.0000.00616.67
7.4.300.0070.00016.54
7.4.290.0000.00716.55
7.4.280.0070.00016.67
7.4.270.0000.00716.57
7.4.260.0030.00313.30
7.4.250.0040.00416.63
7.4.240.0090.00016.61
7.4.230.0000.00716.60
7.4.220.0100.01016.62
7.4.210.0080.00816.59
7.4.200.0000.00816.73
7.4.190.0030.00316.70
7.4.160.0110.00316.50
7.4.150.0070.01116.66
7.4.140.0140.00416.69
7.4.130.0100.00716.72
7.4.120.0130.00616.62
7.4.110.0160.00616.40
7.4.100.0060.01016.58
7.4.90.0100.01016.75
7.4.80.0100.00719.39
7.4.70.0060.01216.61
7.4.60.0060.01016.58
7.4.50.0040.00416.45
7.4.40.0000.01316.58
7.4.30.0070.01016.66
7.4.00.0060.00914.77
7.3.330.0000.00713.41
7.3.320.0070.00013.45
7.3.310.0070.00016.45
7.3.300.0030.00316.42
7.3.290.0100.01016.55
7.3.280.0070.01216.45
7.3.270.0100.00716.63
7.3.260.0110.00516.45
7.3.250.0130.00416.51
7.3.240.0100.00716.47
7.3.230.0140.00416.60
7.3.210.0060.01116.66
7.3.200.0030.01316.47
7.3.190.0110.00616.69
7.3.180.0000.01716.43
7.3.170.0070.01116.48
7.3.160.0100.00616.49
7.3.120.0070.01115.12
7.2.330.0120.00616.77
7.2.320.0120.00916.77
7.2.310.0060.01216.49
7.2.300.0090.00916.68
7.2.290.0100.00716.76
7.1.100.0040.00818.02
7.1.70.0000.01017.21
7.1.60.0150.00919.40
7.1.50.0030.00916.80
7.1.00.0000.04722.33
7.0.200.0180.00914.58
7.0.140.0030.07722.02
7.0.120.0030.07321.95
7.0.60.0030.04020.03
7.0.50.0030.07017.89
7.0.40.0170.07020.11
7.0.30.0200.06020.28
7.0.20.0300.07720.23
7.0.10.0130.05320.21
7.0.00.0030.04020.24
5.6.280.0070.07021.03
5.6.210.0000.07320.53
5.6.200.0030.05318.23
5.6.190.0100.09020.41
5.6.180.3470.04720.61
5.6.170.0330.07320.55
5.6.160.0100.07020.39
5.6.150.0070.03718.14
5.6.140.0030.04718.21
5.6.130.0100.04318.13
5.6.120.0030.08721.15
5.6.110.0100.03720.98
5.6.100.0030.08021.14
5.6.90.0030.09321.00
5.6.80.0030.06320.50
5.6.70.3570.03720.38
5.5.350.0070.08320.34
5.5.340.0030.04318.02
5.5.330.0100.07320.57
5.5.320.0330.02720.42
5.5.310.0270.03720.32
5.5.300.0070.04718.07
5.5.290.0030.06718.04
5.5.280.0030.04320.91
5.5.270.0130.07720.88
5.5.260.0000.07020.81
5.5.250.0230.06720.67
5.5.240.0300.07020.38
5.4.450.0000.08319.32
5.4.440.0270.07319.28
5.4.430.0100.08019.21
5.4.420.0100.05719.54
5.4.410.0100.05319.25
5.4.400.0030.06319.13
5.4.390.0270.06319.02
5.4.380.0200.05718.52
5.4.370.0100.03718.53
5.4.360.0130.05018.51
5.4.350.0030.04512.03
5.4.340.0090.04612.02
5.4.320.0060.03712.52
5.4.310.0060.03812.51
5.4.300.0120.05912.52
5.4.290.0110.06612.51
5.4.280.0110.06812.41
5.4.270.0170.04812.41
5.4.260.0090.04912.41
5.4.250.0100.06612.41
5.4.240.0080.04812.41
5.4.230.0080.04812.40
5.4.220.0070.04912.40
5.4.210.0090.04112.40
5.4.200.0130.05612.40
5.4.190.0060.04412.40
5.4.180.0090.04312.40
5.4.170.0080.04712.41
5.4.160.0120.05312.40
5.4.150.0100.05412.40
5.4.140.0130.06012.08
5.4.130.0070.04512.07
5.4.120.0100.04112.03
5.4.110.0140.06812.03
5.4.100.0110.06112.02
5.4.90.0100.04712.02
5.4.80.0090.04212.02
5.4.70.0090.04212.02
5.4.60.0090.05712.02
5.4.50.0100.04012.02
5.4.40.0080.04112.01
5.4.30.0070.04212.01
5.4.20.0090.04112.01
5.4.10.0070.05512.00
5.4.00.0100.05411.49
5.3.290.0050.04012.80
5.3.280.0100.04212.71
5.3.270.0090.04412.72
5.3.260.0070.04812.72
5.3.250.0090.04912.72
5.3.240.0070.04812.72
5.3.230.0080.04512.71
5.3.220.0090.05112.68
5.3.210.0100.05212.68
5.3.200.0090.04812.68
5.3.190.0130.05312.68
5.3.180.0140.05912.67
5.3.170.0140.06412.67
5.3.160.0120.06012.67
5.3.150.0120.04212.67
5.3.140.0100.04312.66
5.3.130.0120.04712.66
5.3.120.0090.04912.66
5.3.110.0120.06112.66
5.3.100.0110.06712.13
5.3.90.0070.04512.12
5.3.80.0090.04512.11
5.3.70.0090.04412.11
5.3.60.0080.04212.09
5.3.50.0080.04512.04
5.3.40.0090.04212.04
5.3.30.0090.04512.00

preferences:
41.25 ms | 401 KiB | 5 Q