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($errorHandler)) { $errorHandler = function ($errno, $errstr, $errfile = null, $errline = null, $errcontext = []) { // 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 { echo "log $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($errorHandler)) { $errorHandler = function ($errno, $errstr, $errfile = null, $errline = null, $errcontext = []) { // 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 { echo "log $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.0070.00716.75
8.3.50.0110.00822.01
8.3.40.0150.00018.96
8.3.30.0100.01019.17
8.3.20.0080.00020.21
8.3.10.0080.00023.48
8.3.00.0080.00020.94
8.2.180.0090.00618.53
8.2.170.0180.00322.96
8.2.160.0040.01120.16
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0000.00822.20
8.2.110.0060.00319.27
8.2.100.0040.00719.57
8.2.90.0040.00418.16
8.2.80.0030.00517.97
8.2.70.0030.00517.75
8.2.60.0030.00517.92
8.2.50.0000.00918.07
8.2.40.0050.00319.88
8.2.30.0000.00718.27
8.2.20.0040.00417.79
8.2.10.0070.00018.29
8.2.00.0120.00017.72
8.1.280.0110.00325.92
8.1.270.0050.00323.73
8.1.260.0080.00626.35
8.1.250.0000.00828.09
8.1.240.0060.00322.12
8.1.230.0080.00420.85
8.1.220.0080.00017.77
8.1.210.0050.00318.97
8.1.200.0050.00517.35
8.1.190.0030.00617.25
8.1.180.0070.00319.13
8.1.170.0030.00618.63
8.1.160.0050.00222.05
8.1.150.0020.00518.61
8.1.140.0040.00417.55
8.1.130.0070.00017.94
8.1.120.0040.00417.45
8.1.110.0000.00717.42
8.1.100.0000.00717.48
8.1.90.0080.00017.50
8.1.80.0050.00317.55
8.1.70.0060.00317.48
8.1.60.0050.00517.54
8.1.50.0030.00617.62
8.1.40.0030.00917.57
8.1.30.0040.00417.70
8.1.20.0040.00417.72
8.1.10.0040.00417.63
8.1.00.0000.00717.56
8.0.300.0080.00019.98
8.0.290.0040.00416.93
8.0.280.0030.00318.37
8.0.270.0030.00517.29
8.0.260.0030.00317.35
8.0.250.0040.00317.06
8.0.240.0000.01117.00
8.0.230.0000.00717.05
8.0.220.0030.00316.87
8.0.210.0000.00716.85
8.0.200.0000.00716.98
8.0.190.0040.00417.07
8.0.180.0070.00017.01
8.0.170.0000.00817.04
8.0.160.0070.00017.05
8.0.150.0030.00516.86
8.0.140.0050.00216.93
8.0.130.0060.00013.47
8.0.120.0010.00615.17
8.0.110.0010.00615.16
8.0.100.0020.00615.22
8.0.90.0060.00115.12
8.0.80.0030.00815.19
8.0.70.0040.00315.20
8.0.60.0000.00715.23
8.0.50.0020.00515.22
8.0.30.0070.00815.86
8.0.20.0090.00916.09
8.0.10.0010.00615.35
8.0.00.0110.00415.67
7.4.330.0000.00515.00
7.4.320.0030.00316.69
7.4.300.0070.00016.62
7.4.290.0000.00816.45
7.4.280.0060.00316.54
7.4.270.0070.00016.70
7.4.260.0000.00716.53
7.4.250.0070.00114.91
7.4.240.0010.00615.45
7.4.230.0030.00314.80
7.4.220.0050.00815.04
7.4.210.0060.00715.72
7.4.200.0020.00514.90
7.4.190.0040.00315.02
7.4.180.0050.00013.41
7.4.160.0070.00414.94
7.4.150.0080.00315.33
7.4.140.0040.01116.31
7.4.130.0090.00515.58
7.4.120.0090.00715.45
7.4.110.0070.00515.07
7.4.100.0080.00714.89
7.4.90.0080.00514.82
7.4.80.0070.01016.31
7.4.70.0080.00714.84
7.4.60.0100.00514.91
7.4.50.0060.00414.83
7.4.40.0130.00414.82
7.4.30.0090.00514.82
7.4.20.0050.00513.25
7.4.10.0110.00013.38
7.4.00.0050.00914.33
7.3.330.0060.00013.40
7.3.320.0000.00613.54
7.3.310.0020.00714.89
7.3.300.0040.00414.81
7.3.290.0070.00414.94
7.3.280.0090.00915.67
7.3.270.0110.00315.40
7.3.260.0080.00514.88
7.3.250.0070.00915.48
7.3.240.0070.00815.04
7.3.230.0040.01014.91
7.3.220.0040.00413.37
7.3.210.0070.00614.80
7.3.200.0120.00516.38
7.3.190.0020.01114.95
7.3.180.0030.00814.95
7.3.170.0030.00914.86
7.3.160.0070.00514.91
7.3.150.0040.00413.22
7.3.140.0000.00713.23
7.3.130.0060.00013.24
7.3.120.0090.00514.32
7.3.110.0060.00614.16
7.3.100.0090.00514.22
7.3.90.0070.00514.14
7.3.80.0060.00614.04
7.3.70.0070.00414.29
7.3.60.0090.00214.05
7.3.50.0020.00714.19
7.3.40.0020.00614.23
7.3.30.0020.00814.03
7.3.20.0050.00615.97
7.3.10.0060.00215.90
7.3.00.0050.00515.86
7.2.340.0100.00213.27
7.2.330.0100.00615.13
7.2.320.0080.00714.99
7.2.310.0050.01014.96
7.2.300.0050.01015.10
7.2.290.0100.00515.20
7.2.280.0120.00313.36
7.2.270.0120.00213.50
7.2.260.0080.00613.37
7.2.250.0080.00714.41
7.2.240.0100.00714.24
7.2.230.0100.00414.44
7.2.220.0100.00714.37
7.2.210.0080.00714.02
7.2.200.0090.00714.26
7.2.190.0120.00314.35
7.2.180.0070.00514.36
7.2.170.0060.00814.30
7.2.160.0090.00414.24
7.2.150.0050.01116.24
7.2.140.0070.00916.24
7.2.130.0040.01116.13
7.2.120.0030.01016.20
7.2.110.0090.00516.40
7.2.100.0040.01116.20
7.2.90.0070.00616.30
7.2.80.0070.00616.45
7.2.70.0070.00516.50
7.2.60.0110.00816.54
7.2.50.0070.01016.40
7.2.40.0090.00616.50
7.2.30.0060.00816.53
7.2.20.0070.00716.48
7.2.10.0080.00516.48
7.2.00.0070.00917.25
7.1.330.0080.00814.99
7.1.320.0100.00615.24
7.1.310.0100.00415.05
7.1.300.0070.00715.14
7.1.290.0090.00415.14
7.1.280.0060.00715.18
7.1.270.0080.00515.05
7.1.260.0080.00615.02
7.1.250.0080.00715.13
7.1.240.0060.00615.21
7.1.230.0090.00715.21
7.1.220.0070.00615.23
7.1.210.0080.00415.26
7.1.200.0050.00915.45
7.1.190.0060.00715.34
7.1.180.0080.00415.24
7.1.170.0090.00515.19
7.1.160.0060.00515.25
7.1.150.0060.00615.32
7.1.140.0060.00515.37
7.1.130.0070.00615.18
7.1.120.0080.00515.24
7.1.110.0110.00215.33
7.1.100.0110.00516.01
7.1.90.0070.00615.26
7.1.80.0080.00715.35
7.1.70.0040.00915.72
7.1.60.0110.00316.36
7.1.50.0050.00815.70
7.1.40.0070.00415.30
7.1.30.0080.00615.31
7.1.20.0050.00615.25
7.1.10.0070.00615.35
7.1.00.0080.02216.96
7.0.330.0080.00514.68
7.0.320.0070.00515.01
7.0.310.0050.00615.13
7.0.300.0080.00314.85
7.0.290.0070.00614.96
7.0.280.0080.00714.99
7.0.270.0070.00814.95
7.0.260.0090.00214.90
7.0.250.0100.00415.09
7.0.240.0070.00514.98
7.0.230.0080.00715.11
7.0.220.0090.00415.02
7.0.210.0070.00515.09
7.0.200.0050.00815.36
7.0.190.0060.00715.10
7.0.180.0060.00514.95
7.0.170.0070.00615.12
7.0.160.0050.00715.04
7.0.150.0090.00515.00
7.0.140.0030.02616.79
7.0.130.0080.00415.06
7.0.120.0080.00815.13
7.0.110.0080.00615.04
7.0.100.0060.02216.21
7.0.90.0050.02616.34
7.0.80.0080.01916.25
7.0.70.0040.02416.17
7.0.60.0080.02016.28
7.0.50.0090.02316.31
7.0.40.0070.02615.27
7.0.30.0070.02315.33
7.0.20.0080.02415.25
7.0.10.0080.02315.35
7.0.00.0080.02115.34
5.6.400.0080.00513.84
5.6.390.0070.00613.51
5.6.380.0070.00713.95
5.6.370.0090.00414.01
5.6.360.0080.00514.06
5.6.350.0060.00813.87
5.6.340.0080.00614.06
5.6.330.0060.00713.88
5.6.320.0070.00614.01
5.6.310.0070.00713.98
5.6.300.0060.00613.78
5.6.290.0060.00913.96
5.6.280.0060.02415.72
5.6.270.0090.00613.90
5.6.260.0100.00213.84
5.6.250.0070.02015.64
5.6.240.0110.01315.69
5.6.230.0080.02515.56
5.6.220.0120.01415.67
5.6.210.0060.02315.65
5.6.200.0060.02815.87
5.6.190.0090.02415.92
5.6.180.0050.02115.94
5.6.170.0020.02915.69
5.6.160.0100.02215.82
5.6.150.0080.02015.73
5.6.140.0050.02415.72
5.6.130.0070.02615.74
5.6.120.0070.02515.87
5.6.110.0070.02815.76
5.6.100.0090.02015.78
5.6.90.0050.02315.66
5.6.80.0070.01415.47
5.6.70.0060.02415.60
5.6.60.0080.02315.50
5.6.50.0070.01815.65
5.6.40.0090.01915.48
5.6.30.0100.02215.53
5.6.20.0070.02315.61
5.6.10.0090.02315.53
5.6.00.0060.01715.55
5.5.380.0040.02514.87
5.5.370.0070.02014.72
5.5.360.0080.02314.87
5.5.350.0060.02414.77
5.5.340.0090.02314.86
5.5.330.0040.02014.85
5.5.320.0050.02814.87
5.5.310.0040.02614.88
5.5.300.0050.02014.71
5.5.290.0060.01914.79
5.5.280.0080.01514.94
5.5.270.0080.02214.82
5.5.260.0040.02614.85
5.5.250.0050.02214.87
5.5.240.0080.02214.64
5.5.230.0100.02014.67
5.5.220.0030.01814.76
5.5.210.0090.02114.70
5.5.200.0070.02014.61
5.5.190.0070.02014.72
5.5.180.0080.02014.60
5.5.170.0080.00513.95
5.5.160.0060.02614.63
5.5.150.0050.01814.69
5.5.140.0090.01914.63
5.5.130.0060.01914.63
5.5.120.0060.02014.73
5.5.110.0050.02614.67
5.5.100.0080.02214.72
5.5.90.0070.02314.67
5.5.80.0080.01714.55
5.5.70.0060.02014.67
5.5.60.0080.01414.61
5.5.50.0040.02714.58
5.5.40.0080.02214.73
5.5.30.0050.01714.78
5.5.20.0060.01914.74
5.5.10.0070.02514.66
5.5.00.0090.02314.68
5.4.450.0060.02514.03
5.4.440.0050.01714.03
5.4.430.0030.01714.03
5.4.420.0050.02313.98
5.4.410.0080.01813.96
5.4.400.0050.01713.89
5.4.390.0070.01513.90
5.4.380.0070.02013.93
5.4.370.0050.02113.90
5.4.360.0070.01413.99
5.4.350.0080.01213.95
5.4.340.0090.01514.00
5.4.330.0070.00512.30
5.4.320.0070.01814.03
5.4.310.0090.01613.96
5.4.300.0060.01414.01
5.4.290.0060.01313.92
5.4.280.0060.02014.00
5.4.270.0080.01313.95
5.4.260.0080.01113.89
5.4.250.0050.01413.92
5.4.240.0070.01313.95
5.4.230.0090.01113.96
5.4.220.0040.01813.82
5.4.210.0050.01413.87
5.4.200.0070.01913.87
5.4.190.0030.02113.84
5.4.180.0080.02013.82
5.4.170.0050.01613.95
5.4.160.0050.01613.83
5.4.150.0040.01813.89
5.4.140.0020.01713.31
5.4.130.0030.02413.30
5.4.120.0040.01913.32
5.4.110.0060.01213.33
5.4.100.0040.02213.32
5.4.90.0030.02013.32
5.4.80.0030.02013.32
5.4.70.0030.01813.33
5.4.60.0050.01213.27
5.4.50.0060.01113.28
5.4.40.0040.02013.31
5.4.30.0030.02513.37
5.4.20.0060.02113.23
5.4.10.0080.01213.30
5.4.00.0060.01913.13
5.3.290.0060.01212.87
5.3.280.0050.01512.77
5.3.270.0040.02312.87
5.3.260.0040.01512.80
5.3.250.0060.02012.83
5.3.240.0070.01212.79
5.3.230.0030.02212.80
5.3.220.0040.01912.79
5.3.210.0070.02112.78
5.3.200.0030.02312.82
5.3.190.0020.02012.85
5.3.180.0030.01512.83
5.3.170.0060.02112.81
5.3.160.0070.01312.80
5.3.150.0020.02212.85
5.3.140.0040.01712.82
5.3.130.0050.02412.86
5.3.120.0070.01512.87
5.3.110.0050.02212.89
5.3.100.0020.01812.69
5.3.90.0060.02012.74
5.3.80.0030.01812.68
5.3.70.0050.01812.71
5.3.60.0070.01712.70
5.3.50.0030.01512.69
5.3.40.0080.01712.63
5.3.30.0070.02112.69
5.3.20.0060.01512.55
5.3.10.0030.01812.57
5.3.00.0070.01612.51
5.2.170.0040.02211.70
5.2.160.0060.02111.69
5.2.150.0040.02411.77
5.2.140.0020.02311.72
5.2.130.0080.01811.75
5.2.120.0040.01311.75
5.2.110.0060.02211.66
5.2.100.0060.02111.68
5.2.90.0050.01311.68
5.2.80.0070.01911.72
5.2.70.0060.02411.66
5.2.60.0090.02111.71
5.2.50.0060.01911.75
5.2.40.0070.01511.68
5.2.30.0020.02411.71
5.2.20.0030.01911.68
5.2.10.0020.02311.57
5.2.00.0050.01111.56
5.1.60.0040.01811.34
5.1.50.0010.02111.45
5.1.40.0080.00811.49
5.1.30.0050.01511.44
5.1.20.0020.01611.46
5.1.10.0050.01111.38
5.1.00.0040.01511.33
5.0.50.0030.01811.30
5.0.40.0020.01811.30
5.0.30.0020.01411.30
5.0.20.0050.01311.30
5.0.10.0030.01011.30
5.0.00.0070.02011.30
4.4.90.0020.01111.30
4.4.80.0040.01111.30
4.4.70.0000.01311.30
4.4.60.0040.00611.30
4.4.50.0010.01311.30
4.4.40.0020.01211.30
4.4.30.0020.01011.30
4.4.20.0030.01111.30
4.4.10.0020.01311.30
4.4.00.0010.01811.30
4.3.110.0010.01111.30
4.3.100.0030.00511.30
4.3.90.0010.01011.30
4.3.80.0030.01611.30
4.3.70.0030.01211.30
4.3.60.0030.01211.30
4.3.50.0040.00611.30
4.3.40.0010.01611.30
4.3.30.0020.00711.30
4.3.20.0010.00711.30
4.3.10.0020.00511.30
4.3.00.0000.00911.30

preferences:
54.5 ms | 401 KiB | 5 Q