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) { $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) { $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($e); }

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.0040.01116.75
8.3.50.0090.00722.10
8.3.40.0070.01119.06
8.3.30.0100.00319.07
8.3.20.0000.00720.29
8.3.10.0030.00523.53
8.3.00.0040.00420.70
8.2.180.0150.00418.66
8.2.170.0140.00422.96
8.2.160.0110.00420.40
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00022.12
8.2.110.0060.00322.25
8.2.100.0070.00417.84
8.2.90.0030.00619.31
8.2.80.0050.00317.97
8.2.70.0030.00717.63
8.2.60.0000.00918.03
8.2.50.0000.00818.07
8.2.40.0000.00819.95
8.2.30.0000.00718.23
8.2.20.0000.00817.92
8.2.10.0000.00818.11
8.2.00.0000.00917.72
8.1.280.0040.01125.92
8.1.270.0080.00023.97
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0060.00319.29
8.1.230.0000.01220.98
8.1.220.0000.00717.78
8.1.210.0080.00018.77
8.1.200.0070.00317.35
8.1.190.0000.01117.35
8.1.180.0000.00819.14
8.1.170.0040.00418.51
8.1.160.0030.00521.97
8.1.150.0070.00018.69
8.1.140.0030.00517.38
8.1.130.0000.00817.84
8.1.120.0000.00717.49
8.1.110.0000.00817.43
8.1.100.0040.00417.38
8.1.90.0000.00717.52
8.1.80.0000.00817.43
8.1.70.0060.00317.47
8.1.60.0060.00317.66
8.1.50.0030.00717.59
8.1.40.0030.00617.57
8.1.30.0040.00417.61
8.1.20.0040.00417.59
8.1.10.0050.00317.64
8.1.00.0050.00317.47
8.0.300.0000.00718.77
8.0.290.0040.00417.18
8.0.280.0040.00418.41
8.0.270.0040.00417.32
8.0.260.0040.00217.24
8.0.250.0030.00317.01
8.0.240.0070.00317.04
8.0.230.0050.00317.01
8.0.220.0000.00716.89
8.0.210.0070.00016.88
8.0.200.0040.00417.00
8.0.190.0000.00817.07
8.0.180.0040.00417.05
8.0.170.0030.00517.01
8.0.160.0070.00017.05
8.0.150.0000.00716.90
8.0.140.0040.00416.85
8.0.130.0000.00513.43
8.0.120.0070.00215.14
8.0.110.0050.00415.15
8.0.100.0060.00315.18
8.0.90.0050.00415.16
8.0.80.0120.00015.21
8.0.70.0070.00415.20
8.0.60.0000.00915.18
8.0.50.0070.00215.09
8.0.30.0100.00715.87
8.0.20.0100.00816.05
8.0.10.0040.00615.24
8.0.00.0080.00715.65
7.4.330.0000.00515.00
7.4.320.0040.00416.54
7.4.300.0030.00316.56
7.4.290.0000.00716.67
7.4.280.0030.00616.61
7.4.270.0040.00416.45
7.4.260.0000.00716.61
7.4.250.0060.00214.91
7.4.240.0050.00415.45
7.4.230.0070.00314.99
7.4.220.0090.00514.97
7.4.210.0080.00615.77
7.4.200.0050.00414.88
7.4.190.0050.00315.05
7.4.180.0000.00613.39
7.4.160.0080.00614.94
7.4.150.0040.00715.31
7.4.140.0080.00616.29
7.4.130.0090.00615.39
7.4.120.0140.00115.52
7.4.110.0040.00914.95
7.4.100.0070.00714.84
7.4.90.0080.00714.85
7.4.80.0120.00616.33
7.4.70.0090.00714.88
7.4.60.0060.00814.88
7.4.50.0080.00214.75
7.4.40.0050.00814.85
7.4.30.0090.00714.85
7.4.20.0080.00413.24
7.4.10.0100.00313.34
7.4.00.0070.00714.24
7.3.330.0000.00613.38
7.3.320.0000.00613.36
7.3.310.0060.00414.92
7.3.300.0070.00214.86
7.3.290.0030.00914.84
7.3.280.0080.00715.57
7.3.270.0080.00515.33
7.3.260.0100.00414.86
7.3.250.0060.00815.33
7.3.240.0090.00714.88
7.3.230.0050.00815.00
7.3.220.0090.00013.35
7.3.210.0080.00914.73
7.3.200.0090.00716.34
7.3.190.0160.00014.93
7.3.180.0120.00414.90
7.3.170.0050.01014.93
7.3.160.0060.00614.83
7.3.150.0050.00413.24
7.3.140.0060.00313.33
7.3.130.0020.00413.15
7.3.120.0030.00813.99
7.3.110.0070.00013.27
7.3.100.0070.00313.24
7.3.90.0030.00313.57
7.3.80.0050.00213.34
7.3.70.0040.00413.48
7.3.60.0070.00013.54
7.3.50.0030.00313.54
7.3.40.0030.00313.39
7.3.30.0000.00713.49
7.3.20.0030.00315.17
7.3.10.0070.00014.94
7.3.00.0070.00015.08
7.2.340.0080.00613.35
7.2.330.0060.00915.07
7.2.320.0070.00915.13
7.2.310.0070.00815.09
7.2.300.0100.00515.06
7.2.290.0130.00315.16
7.2.280.0090.00413.48
7.2.270.0100.00313.34
7.2.260.0110.00213.43
7.2.250.0100.00213.30
7.2.240.0130.00013.43
7.2.230.0080.00513.34
7.2.220.0070.00713.33
7.2.210.0090.00413.43
7.2.200.0140.00013.49
7.2.190.0130.00013.62
7.2.180.0120.00013.59
7.2.170.0120.00013.50
7.2.160.0120.00013.65
7.2.150.0080.00615.45
7.2.140.0100.00315.39
7.2.130.0100.00315.55
7.2.120.0080.00415.45
7.2.110.0150.00815.94
7.2.100.0100.00315.28
7.2.90.0050.01015.42
7.2.80.0070.00715.38
7.2.70.0100.00315.49
7.2.60.0130.00015.32
7.2.50.0100.00315.24
7.2.40.0100.00315.24
7.2.30.0070.00715.27
7.2.20.0110.00315.46
7.2.10.0090.00415.48
7.2.00.0070.00717.61
7.1.330.0090.00314.41
7.1.320.0040.00814.47
7.1.310.0120.00014.29
7.1.300.0120.00014.35
7.1.290.0000.01214.39
7.1.280.0120.00014.39
7.1.270.0090.00314.38
7.1.260.0120.00014.29
7.1.250.0060.00614.25
7.1.240.0060.00614.41
7.1.230.0080.00414.24
7.1.220.0080.00414.29
7.1.210.0120.00014.36
7.1.200.0060.00614.47
7.1.190.0120.00014.29
7.1.180.0060.00614.15
7.1.170.0110.00014.33
7.1.160.0080.00414.22
7.1.150.0030.00914.33
7.1.140.0070.00514.35
7.1.130.0060.00614.34
7.1.120.0040.00814.22
7.1.110.0130.00014.38
7.1.100.0140.00516.34
7.1.90.0130.00014.21
7.1.80.0120.00014.41
7.1.70.0040.00615.58
7.1.60.0050.01316.91
7.1.50.0030.01515.54
7.1.40.0120.00014.30
7.1.30.0000.01314.43
7.1.20.0120.00014.31
7.1.10.0060.00614.36
7.1.00.0090.03818.28
7.0.330.0090.00314.17
7.0.320.0100.00313.96
7.0.310.0060.00614.16
7.0.300.0070.00514.21
7.0.290.0100.00314.25
7.0.280.0080.00414.04
7.0.270.0060.00614.18
7.0.260.0000.01114.12
7.0.250.0060.00614.20
7.0.240.0080.00414.38
7.0.230.0130.00014.16
7.0.220.0090.00214.13
7.0.210.0060.00614.14
7.0.200.0050.00515.54
7.0.190.0070.00414.32
7.0.180.0120.00014.27
7.0.170.0080.00414.36
7.0.160.0090.00314.07
7.0.150.0080.00414.25
7.0.140.0060.03718.11
7.0.130.0060.00614.26
7.0.120.0100.00214.08
7.0.110.0100.00514.25
7.0.100.0100.02417.26
7.0.90.0060.03516.98
7.0.80.0100.04117.12
7.0.70.0070.03817.03
7.0.60.0090.03917.03
7.0.50.0080.03617.12
7.0.40.0060.04217.05
7.0.30.0090.04717.16
7.0.20.0120.03217.15
7.0.10.0090.03117.13
7.0.00.0120.03517.10
5.6.400.0080.00412.75
5.6.390.0070.00412.87
5.6.380.0030.00912.55
5.6.370.0070.00412.91
5.6.360.0040.00812.78
5.6.350.0040.00812.95
5.6.340.0110.00012.75
5.6.330.0080.00312.75
5.6.320.0120.00012.68
5.6.310.0110.00012.75
5.6.300.0090.00212.68
5.6.290.0040.00812.65
5.6.280.0110.03116.98
5.6.270.0070.00412.68
5.6.260.0070.00412.77
5.6.250.0080.04316.71
5.6.240.0060.04416.74
5.6.230.0040.04416.83
5.6.220.0080.04516.81
5.6.210.0030.04616.88
5.6.200.0060.04717.20
5.6.190.0050.04016.98
5.6.180.0080.03317.13
5.6.170.0050.04717.08
5.6.160.0070.04417.08
5.6.150.0060.03017.04
5.6.140.0120.03717.06
5.6.130.0070.04217.10
5.6.120.0170.03317.01
5.6.110.0090.03816.97
5.6.100.0110.03317.05
5.6.90.0100.02317.01
5.6.80.0050.04516.67
5.6.70.0070.03616.69
5.6.60.0100.03816.79
5.6.50.0080.04116.66
5.6.40.0030.04216.66
5.6.30.0070.04416.66
5.6.20.0090.03116.56
5.6.10.0120.03316.65
5.6.00.0130.03516.72
5.5.380.0020.03616.59
5.5.370.0110.03816.70
5.5.360.0060.03916.64
5.5.350.0090.04016.56
5.5.340.0080.04316.90
5.5.330.0050.04316.73
5.5.320.0070.02516.83
5.5.310.0060.04016.87
5.5.300.0080.04116.67
5.5.290.0090.04516.82
5.5.280.0140.04016.88
5.5.270.0060.03816.73
5.5.260.0130.03516.93
5.5.250.0050.03516.82
5.5.240.0090.04316.55
5.5.230.0050.04616.45
5.5.220.0070.02516.43
5.5.210.0110.03616.62
5.5.200.0100.04016.45
5.5.190.0080.04316.43
5.5.180.0130.03816.41
5.5.170.0080.00412.70
5.5.160.0080.03116.36
5.5.150.0060.04416.41
5.5.140.0070.03916.51
5.5.130.0080.02816.45
5.5.120.0120.02316.26
5.5.110.0050.03416.32
5.5.100.0070.04416.45
5.5.90.0080.04116.52
5.5.80.0070.03816.46
5.5.70.0060.04116.47
5.5.60.0080.04016.46
5.5.50.0070.03516.50
5.5.40.0100.03816.48
5.5.30.0090.03916.40
5.5.20.0030.02916.48
5.5.10.0100.03716.46
5.5.00.0070.03816.34
5.4.450.0160.03316.12
5.4.440.0070.04016.08
5.4.430.0110.03616.04
5.4.420.0050.03516.19
5.4.410.0080.03816.05
5.4.400.0100.03215.84
5.4.390.0090.03315.97
5.4.380.0060.04316.00
5.4.370.0120.03015.82
5.4.360.0060.04115.85
5.4.350.0060.02615.96
5.4.340.0110.03615.96
5.4.330.0080.00312.63
5.4.320.0100.03216.00
5.4.310.0040.04215.91
5.4.300.0040.04415.94
5.4.290.0060.04315.99
5.4.280.0090.03215.89
5.4.270.0090.02816.00
5.4.260.0020.04415.83
5.4.250.0090.02316.01
5.4.240.0090.04115.94
5.4.230.0060.04115.75
5.4.220.0090.04215.79
5.4.210.0150.03215.76
5.4.200.0070.04015.91
5.4.190.0050.02515.95
5.4.180.0090.03715.96
5.4.170.0050.04115.93
5.4.160.0090.02815.69
5.4.150.0060.03315.89
5.4.140.0070.03314.59
5.4.130.0030.03514.62
5.4.120.0050.02114.53
5.4.110.0040.03814.66
5.4.100.0050.02914.53
5.4.90.0070.03814.60
5.4.80.0080.01714.64
5.4.70.0090.03714.63
5.4.60.0030.03514.67
5.4.50.0020.04214.44
5.4.40.0040.04114.60
5.4.30.0090.03714.67
5.4.20.0060.03714.49
5.4.10.0090.03514.60
5.4.00.0070.03914.23
5.3.290.0080.04013.66
5.3.280.0090.02713.70
5.3.270.0060.04213.69
5.3.260.0080.03713.66
5.3.250.0030.04213.65
5.3.240.0050.04213.70
5.3.230.0070.02713.70
5.3.220.0060.03613.64
5.3.210.0040.02613.72
5.3.200.0070.03213.61
5.3.190.0090.03613.66
5.3.180.0070.03813.66
5.3.170.0060.03813.79
5.3.160.0070.03913.78
5.3.150.0080.04013.85
5.3.140.0090.03713.69
5.3.130.0090.04013.80
5.3.120.0090.03713.63
5.3.110.0090.02813.73
5.3.100.0040.02813.43
5.3.90.0040.03913.42
5.3.80.0050.04013.28
5.3.70.0040.02913.41
5.3.60.0040.03613.36
5.3.50.0070.03713.25
5.3.40.0050.03213.32
5.3.30.0030.04013.32
5.3.20.0070.03713.15
5.3.10.0060.02813.16
5.3.00.0100.02513.15
5.2.170.0020.03411.39
5.2.160.0070.02911.57
5.2.150.0060.03311.56
5.2.140.0040.03411.51
5.2.130.0030.03311.37
5.2.120.0060.03111.38
5.2.110.0030.03311.43
5.2.100.0080.02011.44
5.2.90.0030.03311.41
5.2.80.0060.02311.38
5.2.70.0050.03011.31
5.2.60.0030.03411.33
5.2.50.0080.02711.36
5.2.40.0040.03111.23
5.2.30.0050.03511.19
5.2.20.0040.03011.30
5.2.10.0050.01511.25
5.2.00.0030.03210.96
5.1.60.0030.02910.48
5.1.50.0060.02710.50
5.1.40.0040.01510.33
5.1.30.0060.03010.64
5.1.20.0040.02310.59
5.1.10.0050.02710.32
5.1.00.0080.02510.31
5.0.50.0040.0229.78
5.0.40.0050.0239.78
5.0.30.0020.0329.78
5.0.20.0070.0179.78
5.0.10.0030.0259.78
5.0.00.0040.0339.78
4.4.90.0020.0189.78
4.4.80.0040.0179.78
4.4.70.0040.0189.78
4.4.60.0010.0199.78
4.4.50.0020.0179.78
4.4.40.0020.0279.78
4.4.30.0030.0109.78
4.4.20.0000.0209.78
4.4.10.0040.0129.78
4.4.00.0020.0179.78
4.3.110.0070.0139.78
4.3.100.0050.0159.78
4.3.90.0040.0179.78
4.3.80.0060.0259.78
4.3.70.0010.0199.78
4.3.60.0020.0159.78
4.3.50.0050.0179.78
4.3.40.0030.0259.78
4.3.30.0020.0189.78
4.3.20.0000.0209.78
4.3.10.0010.0219.78
4.3.00.0020.0129.78

preferences:
56.64 ms | 400 KiB | 5 Q