3v4l.org

run code in 300+ PHP versions simultaneously
<?php try { if (!function_exists('handleException')) { /** * @param \Exception $e * @return string readable message */ function logException(\Exception $e) { $type = get_class($e); $msg = $e->getMessage(); $trace = $e->getTraceAsString(); global $logger; if (isset($logger)) { $logger->error(sprintf("%s: %s\n%s", $type, $msg, $trace)); if (method_exists($logger, 'newrelicLog')) { $logger->newrelicLog($e); } } return sprintf("<h1>%s</h1><pre>%s<br/><h2>Debug Trace:</h2>%s</pre>", $type, $msg, $trace); } function handleException(\Exception $e) { ob_clean(); $message = logException($e); if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } trigger_error('boo'); exit(); } } if (!isset($shutdownFunction)) { $shutdownFunction = function () { try { $error = error_get_last(); if (isset($error)) { throw new \Exception( $error['message'] . ' in ' . $error['file'] . ' at line ' . $error['line'], $error['type'] ); } } catch (Exception $e) { handleException($e); } }; register_shutdown_function($shutdownFunction); } if (isset($logger) && !isset($errorHandler)) { $errorHandler = function ($errno, $errstr, $errfile = null, $errline = null, $errcontext = []) use ($logger) { // prevent exception to be thrown when error_reporting is turned off or suppressed with @ if (error_reporting() !== 0) { throw new \Exception("$errstr in $errfile at line $errline", $errno); } else { $logger->error("$errstr in $errfile at line $errline"); } }; set_error_handler($errorHandler); } if (!function_exists('handleException')) { /** * @param \Exception $e * @return string readable message */ function logException(\Exception $e) { $type = get_class($e); $msg = $e->getMessage(); $trace = $e->getTraceAsString(); global $logger; if (isset($logger)) { $logger->error(sprintf("%s: %s\n%s", $type, $msg, $trace)); if (method_exists($logger, 'newrelicLog')) { $logger->newrelicLog($e); } } return sprintf("<h1>%s</h1><pre>%s<br/><h2>Debug Trace:</h2>%s</pre>", $type, $msg, $trace); } function handleException(\Exception $e) { ob_clean(); $message = logException($e); if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } include dirname(__FILE__) . '../modules/frontend/views/error/exception.phtml'; exit(); } } if (!isset($shutdownFunction)) { $shutdownFunction = function () { try { $error = error_get_last(); if (isset($error)) { throw new \Exception( $error['message'] . ' in ' . $error['file'] . ' at line ' . $error['line'], $error['type'] ); } } catch (Exception $e) { handleException($e); } }; register_shutdown_function($shutdownFunction); } if (isset($logger) && !isset($errorHandler)) { $errorHandler = function ($errno, $errstr, $errfile = null, $errline = null, $errcontext = []) use ($logger) { // prevent exception to be thrown when error_reporting is turned off or suppressed with @ if (error_reporting() !== 0) { throw new \Exception("$errstr in $errfile at line $errline", $errno); } else { $logger->error("$errstr in $errfile at line $errline"); } }; set_error_handler($errorHandler); } throw new \Exception('after both'); } catch (\Exception $e) { handleException(); }

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.0090.00616.75
8.3.50.0170.00522.15
8.3.40.0070.00718.79
8.3.30.0140.00019.04
8.3.20.0080.00020.35
8.3.10.0040.00423.64
8.3.00.0040.00420.88
8.2.180.0080.01118.66
8.2.170.0120.00322.96
8.2.160.0110.00420.35
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0050.00322.29
8.2.110.0060.00322.25
8.2.100.0080.00418.03
8.2.90.0000.00819.25
8.2.80.0040.00417.97
8.2.70.0090.00017.63
8.2.60.0080.00017.93
8.2.50.0030.00518.07
8.2.40.0080.00019.97
8.2.30.0070.00018.47
8.2.20.0040.00418.00
8.2.10.0040.00418.16
8.2.00.0070.00317.86
8.1.280.0140.00025.92
8.1.270.0030.00523.87
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0070.00323.76
8.1.230.0040.00822.63
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0040.00717.35
8.1.190.0060.00317.47
8.1.180.0000.00819.14
8.1.170.0060.00318.72
8.1.160.0000.00722.07
8.1.150.0030.00518.74
8.1.140.0030.00517.55
8.1.130.0040.00417.79
8.1.120.0040.00417.38
8.1.110.0040.00417.39
8.1.100.0000.00817.50
8.1.90.0030.00517.55
8.1.80.0050.00217.52
8.1.70.0070.00417.50
8.1.60.0060.00317.70
8.1.50.0030.00717.48
8.1.40.0100.00017.45
8.1.30.0000.00917.70
8.1.20.0000.00817.75
8.1.10.0050.00317.54
8.1.00.0050.00317.52
8.0.300.0050.00218.77
8.0.290.0000.00717.30
8.0.280.0000.00718.50
8.0.270.0070.00017.43
8.0.260.0080.00017.23
8.0.250.0050.00216.99
8.0.240.0030.00716.95
8.0.230.0000.00817.07
8.0.220.0020.00516.92
8.0.210.0030.00317.05
8.0.200.0000.00817.09
8.0.190.0040.00417.13
8.0.180.0040.00416.95
8.0.170.0080.00016.94
8.0.160.0000.00716.98
8.0.150.0020.00516.98
8.0.140.0040.00416.90
8.0.130.0030.00313.43
8.0.120.0050.00215.20
8.0.110.0030.00315.18
8.0.100.0050.00315.23
8.0.90.0020.00515.27
8.0.80.0050.00515.21
8.0.70.0040.00315.18
8.0.60.0050.00215.19
8.0.50.0000.00715.22
8.0.30.0060.01016.06
8.0.20.0070.00716.07
8.0.10.0010.00515.28
8.0.00.0100.00515.73
7.4.330.0050.00015.00
7.4.320.0030.00316.68
7.4.300.0030.00316.55
7.4.290.0000.00716.64
7.4.280.0040.00416.64
7.4.270.0040.00416.63
7.4.260.0070.00016.59
7.4.250.0000.00614.87
7.4.240.0030.00315.54
7.4.230.0020.00515.01
7.4.220.0060.00615.00
7.4.210.0080.00615.86
7.4.200.0050.00214.97
7.4.190.0020.00614.89
7.4.180.0060.00013.44
7.4.160.0050.00715.12
7.4.150.0080.00515.38
7.4.140.0110.00216.33
7.4.130.0070.00715.51
7.4.120.0080.00615.49
7.4.110.0040.00714.93
7.4.100.0070.00514.89
7.4.90.0050.00814.90
7.4.80.0080.00616.39
7.4.70.0090.00614.87
7.4.60.0050.00814.78
7.4.50.0030.00414.88
7.4.40.0050.00514.85
7.4.30.0070.00514.92
7.4.20.0030.00313.25
7.4.10.0050.00013.45
7.4.00.0040.01014.43
7.3.330.0070.00013.20
7.3.320.0000.00513.27
7.3.310.0030.00314.75
7.3.300.0010.00514.73
7.3.290.0100.00614.78
7.3.280.0050.01115.67
7.3.270.0030.00815.40
7.3.260.0080.00315.00
7.3.250.0110.00415.53
7.3.240.0050.00714.89
7.3.230.0060.00514.87
7.3.220.0030.00313.35
7.3.210.0050.00714.88
7.3.200.0060.00616.36
7.3.190.0070.00514.95
7.3.180.0060.00414.88
7.3.170.0080.00314.97
7.3.160.0030.00814.89
7.3.150.0060.00013.32
7.3.140.0000.00513.13
7.3.130.0030.00313.29
7.3.120.0050.00814.44
7.3.110.0050.00713.89
7.3.100.0050.00414.10
7.3.90.0060.00414.30
7.3.80.0030.00613.99
7.3.70.0050.00814.06
7.3.60.0080.00314.19
7.3.50.0040.00514.11
7.3.40.0040.00414.06
7.3.30.0050.00414.13
7.3.20.0020.00816.03
7.3.10.0040.00415.83
7.3.00.0090.00015.96
7.2.340.0000.01313.48
7.2.330.0090.00715.00
7.2.320.0130.00415.12
7.2.310.0090.00615.00
7.2.300.0070.00815.21
7.2.290.0100.00515.10
7.2.280.0080.00413.29
7.2.270.0120.00013.50
7.2.260.0130.00013.44
7.2.250.0080.00714.17
7.2.240.0130.00414.46
7.2.230.0080.00714.09
7.2.220.0080.00714.18
7.2.210.0080.00314.25
7.2.200.0070.00814.27
7.2.190.0080.00614.26
7.2.180.0030.00814.43
7.2.170.0060.00714.45
7.2.160.0130.00013.66
7.2.150.0140.00015.37
7.2.140.0110.00315.27
7.2.130.0060.00615.45
7.2.120.0130.00015.58
7.2.110.0110.00515.43
7.2.100.0030.01115.35
7.2.90.0140.00015.43
7.2.80.0060.00815.33
7.2.70.0110.00315.32
7.2.60.0050.01016.06
7.2.50.0080.00515.27
7.2.40.0110.00315.45
7.2.30.0030.01215.49
7.2.20.0140.00015.50
7.2.10.0080.00815.56
7.2.00.0110.00317.56
7.1.330.0120.00215.12
7.1.320.0120.00215.13
7.1.310.0070.00515.16
7.1.300.0070.00615.17
7.1.290.0110.00515.17
7.1.280.0100.00215.10
7.1.270.0070.00715.00
7.1.260.0070.00715.06
7.1.250.0140.00014.23
7.1.240.0100.00514.23
7.1.230.0050.00914.33
7.1.220.0140.00014.38
7.1.210.0150.00014.39
7.1.200.0110.00414.90
7.1.190.0110.00314.39
7.1.180.0110.00414.30
7.1.170.0140.00014.35
7.1.160.0000.01514.34
7.1.150.0120.00214.19
7.1.140.0130.00014.29
7.1.130.0070.00714.15
7.1.120.0050.01014.32
7.1.110.0120.00414.24
7.1.100.0190.00616.11
7.1.90.0070.00714.34
7.1.80.0180.00014.46
7.1.70.0040.00715.66
7.1.60.0090.00716.97
7.1.50.0100.00815.69
7.1.40.0140.00014.18
7.1.30.0110.00214.48
7.1.20.0090.00514.36
7.1.10.0140.00014.32
7.1.00.0080.04318.38
7.0.330.0130.00013.99
7.0.320.0130.00014.14
7.0.310.0110.00314.00
7.0.300.0080.00414.19
7.0.290.0070.00714.13
7.0.280.0120.00014.18
7.0.270.0070.00513.96
7.0.260.0110.00414.16
7.0.250.0040.00814.20
7.0.240.0080.00414.18
7.0.230.0110.00014.38
7.0.220.0120.00014.31
7.0.210.0040.00814.14
7.0.200.0030.00715.54
7.0.190.0100.00214.32
7.0.180.0040.00814.14
7.0.170.0040.00814.35
7.0.160.0120.00014.26
7.0.150.0080.00414.25
7.0.140.0060.03818.00
7.0.130.0040.00814.27
7.0.120.0060.00614.19
7.0.110.0130.00014.34
7.0.100.0070.02617.11
7.0.90.0090.03717.06
7.0.80.0170.04017.03
7.0.70.0110.03817.03
7.0.60.0180.02317.04
7.0.50.0160.02817.09
7.0.40.0140.04017.11
7.0.30.0070.04017.07
7.0.20.0090.04517.12
7.0.10.0040.04517.21
7.0.00.0100.04317.09
5.6.400.0040.00712.91
5.6.390.0060.00612.80
5.6.380.0100.00312.80
5.6.370.0110.00012.60
5.6.360.0110.00012.84
5.6.350.0080.00412.92
5.6.340.0080.00312.93
5.6.330.0090.00212.96
5.6.320.0070.00512.87
5.6.310.0070.00612.77
5.6.300.0090.00212.75
5.6.290.0090.00312.65
5.6.280.0040.04016.90
5.6.270.0110.00012.52
5.6.260.0080.00412.94
5.6.250.0080.04216.73
5.6.240.0070.03216.78
5.6.230.0070.04116.78
5.6.220.0070.02316.69
5.6.210.0040.02316.84
5.6.200.0120.03716.90
5.6.190.0070.04216.90
5.6.180.0080.02816.94
5.6.170.0120.03917.08
5.6.160.0110.02316.96
5.6.150.0040.02917.09
5.6.140.0080.05017.06
5.6.130.0100.02517.13
5.6.120.0060.02316.94
5.6.110.0160.02017.02
5.6.100.0050.05216.82
5.6.90.0060.02416.79
5.6.80.0060.02116.64
5.6.70.0100.03416.73
5.6.60.0120.03816.62
5.6.50.0110.02716.47
5.6.40.0060.03016.73
5.6.30.0080.02016.55
5.6.20.0080.02016.61
5.6.10.0090.02316.63
5.6.00.0060.02216.55
5.5.380.0100.04316.67
5.5.370.0070.04116.61
5.5.360.0120.02816.47
5.5.350.0060.03316.52
5.5.340.0090.02716.80
5.5.330.0070.03616.71
5.5.320.0060.02716.88
5.5.310.0080.02916.63
5.5.300.0060.04416.76
5.5.290.0090.02416.85
5.5.280.0180.04216.78
5.5.270.0100.02016.83
5.5.260.0100.04316.66
5.5.250.0080.02616.71
5.5.240.0060.03316.60
5.5.230.0060.02816.58
5.5.220.0100.03716.55
5.5.210.0060.03616.47
5.5.200.0100.03816.36
5.5.190.0100.03616.44
5.5.180.0080.02116.47
5.5.170.0060.00612.86
5.5.160.0040.02516.45
5.5.150.0060.02116.43
5.5.140.0060.02116.26
5.5.130.0080.02416.43
5.5.120.0030.02216.38
5.5.110.0070.02416.32
5.5.100.0140.02016.50
5.5.90.0000.02716.40
5.5.80.0050.02716.52
5.5.70.0070.02016.49
5.5.60.0060.02016.52
5.5.50.0070.02016.51
5.5.40.0050.02616.58
5.5.30.0070.02016.53
5.5.20.0070.02116.46
5.5.10.0050.02116.43
5.5.00.0030.02416.44
5.4.450.0080.03116.09
5.4.440.0050.03716.04
5.4.430.0080.04015.97
5.4.420.0060.04116.16
5.4.410.0050.02416.11
5.4.400.0060.04415.79
5.4.390.0130.03015.84
5.4.380.0030.04415.93
5.4.370.0130.03715.77
5.4.360.0070.02215.84
5.4.350.0070.02215.83
5.4.340.0060.02315.92
5.4.330.0040.00712.67
5.4.320.0070.02215.86
5.4.310.0040.02316.01
5.4.300.0070.02015.87
5.4.290.0030.02315.81
5.4.280.0100.01715.89
5.4.270.0060.02115.82
5.4.260.0110.01515.94
5.4.250.0060.02216.00
5.4.240.0020.02516.02
5.4.230.0070.01815.96
5.4.220.0070.01815.78
5.4.210.0040.02315.70
5.4.200.0060.02315.84
5.4.190.0070.02215.58
5.4.180.0090.01615.78
5.4.170.0070.02015.82
5.4.160.0070.02015.78
5.4.150.0030.02215.96
5.4.140.0050.01814.56
5.4.130.0060.01914.53
5.4.120.0050.02014.73
5.4.110.0060.02014.52
5.4.100.0000.02514.75
5.4.90.0070.01814.64
5.4.80.0060.01914.63
5.4.70.0020.02314.61
5.4.60.0070.01714.71
5.4.50.0020.01814.53
5.4.40.0060.01714.64
5.4.30.0000.02814.50
5.4.20.0050.02214.65
5.4.10.0040.02114.44
5.4.00.0070.02014.13
5.3.290.0060.02113.70
5.3.280.0050.01813.56
5.3.270.0060.02013.76
5.3.260.0080.01813.66
5.3.250.0060.02113.84
5.3.240.0030.02013.73
5.3.230.0050.02313.58
5.3.220.0090.01513.67
5.3.210.0070.01813.65
5.3.200.0070.01813.54
5.3.190.0040.02113.67
5.3.180.0120.01213.78
5.3.170.0020.02513.68
5.3.160.0050.02013.73
5.3.150.0050.01713.69
5.3.140.0050.01713.76
5.3.130.0060.01813.84
5.3.120.0040.02613.75
5.3.110.0070.01813.66
5.3.100.0050.02013.48
5.3.90.0050.01913.41
5.3.80.0060.02013.51
5.3.70.0050.02113.45
5.3.60.0070.01813.33
5.3.50.0060.01813.48
5.3.40.0090.01413.38
5.3.30.0060.03813.39
5.3.20.0030.03713.29
5.3.10.0050.02212.99
5.3.00.0120.03413.13
5.2.170.0040.03111.36
5.2.160.0020.01611.54
5.2.150.0030.01811.37
5.2.140.0000.01911.34
5.2.130.0060.03211.37
5.2.120.0060.02911.30
5.2.110.0030.03311.51
5.2.100.0070.01311.54
5.2.90.0030.01811.50
5.2.80.0060.03311.43
5.2.70.0030.02211.32
5.2.60.0020.03011.38
5.2.50.0070.03011.29
5.2.40.0040.03411.35
5.2.30.0050.02311.25
5.2.20.0020.02211.26
5.2.10.0050.03211.26
5.2.00.0050.01711.16
5.1.60.0040.01510.43
5.1.50.0080.02510.34
5.1.40.0060.02610.39
5.1.30.0070.02710.73
5.1.20.0050.01610.63
5.1.10.0040.02810.53
5.1.00.0040.02010.46
5.0.50.0070.0179.91
5.0.40.0020.0159.91
5.0.30.0070.0179.91
5.0.20.0020.0129.91
5.0.10.0070.0209.91
5.0.00.0030.0239.91
4.4.90.0000.0149.91
4.4.80.0010.0199.91
4.4.70.0070.0129.91
4.4.60.0020.0089.91
4.4.50.0030.0179.91
4.4.40.0030.0129.91
4.4.30.0030.0179.91
4.4.20.0030.0199.91
4.4.10.0020.0129.91
4.4.00.0030.0229.91
4.3.110.0050.0129.91
4.3.100.0000.0109.91
4.3.90.0030.0179.91
4.3.80.0040.0229.91
4.3.70.0040.0109.91
4.3.60.0020.0159.91
4.3.50.0040.0129.91
4.3.40.0000.0159.91
4.3.30.0000.0119.91
4.3.20.0050.0159.91
4.3.10.0020.0169.91
4.3.00.0010.0109.91

preferences:
43.28 ms | 401 KiB | 5 Q