3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ExceptionHandling { private static $uncaught_exception = null; private static $fatal_error = null; public static function shutdown_callback() { if (defined('GRACEFUL_SHUTDOWN')) { // everything went fine ob_end_flush(); return; } header('Status: 500 Internal Server Error'); include(APP_PATH.'/errors/500.php'); } // turn errors into exceptions public static function exception_error_handler($errno, $errstr, $errfile, $errline) { // hhvm can report fatals as errors. We can not convert them to exceptions, however, because they will // not trigger the exception handler and the stack trace is wrong, anyway. We need to save the errfile and // errline here because they are not available in the shutdown function. // for the errno, see https://github.com/facebook/hhvm/blob/master/hphp/runtime/base/runtime-error.h#L57 if ($errno & (1 << 24)) { self::$fatal_error = array( 'message' => $errstr, 'type' => $errno, 'file' => $errfile, 'line' => $errline ); } if (error_reporting() === 0) { return false; // code used @ to suppress errors } throw new ErrorException($errstr, 0, $errno, $errfile, $errline); } public static function exception_handler($exception) { self::$uncaught_exception = $exception; } /** * @return Exception|null the exception that caused the app to crash, or null if there was none */ public static function get_uncaught_exception() { return self::$uncaught_exception; } /** * Gets the last error that has occurred, be it fatal or non-fatal * @return array with the fields message, type, file and line */ public static function get_last_error() { if (self::$fatal_error) { return self::$fatal_error; } return error_get_last(); } } register_shutdown_function(array('ExceptionHandling', 'shutdown_callback')); set_error_handler(array('ExceptionHandling', "exception_error_handler")); set_exception_handler(array('ExceptionHandling', 'exception_handler')); dklfajelkwa;

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.0120.00918.55
8.3.50.0100.01021.87
8.3.40.0170.00318.98
8.3.30.0070.00719.20
8.3.20.0080.00020.70
8.3.10.0070.00023.65
8.3.00.0050.00319.15
8.2.180.0000.01516.88
8.2.170.0110.00719.08
8.2.160.0070.00722.96
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0040.00421.20
8.2.110.0100.00021.94
8.2.100.0050.00517.91
8.2.90.0040.00417.63
8.2.80.0060.00318.90
8.2.70.0040.00417.63
8.2.60.0060.00317.63
8.2.50.0040.00417.38
8.2.40.0030.00517.63
8.2.30.0000.00718.11
8.2.20.0050.00317.73
8.2.10.0050.00318.05
8.2.00.0000.00717.96
8.1.280.0070.00725.92
8.1.270.0080.00020.43
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0030.00623.73
8.1.230.0040.00723.93
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0080.00017.35
8.1.190.0040.00717.25
8.1.180.0040.00418.10
8.1.170.0090.00017.62
8.1.160.0070.00021.89
8.1.150.0000.00718.88
8.1.140.0000.00717.45
8.1.130.0050.00317.73
8.1.120.0040.00417.38
8.1.110.0040.00417.38
8.1.100.0020.00517.37
8.1.90.0000.00817.44
8.1.80.0000.00717.44
8.1.70.0030.00317.26
8.1.60.0040.00417.55
8.1.50.0040.00417.40
8.1.40.0030.00617.56
8.1.30.0060.00317.57
8.1.20.0040.00417.69
8.1.10.0040.00417.50
8.1.00.0060.00317.51
8.0.300.0000.00918.77
8.0.290.0000.00816.75
8.0.280.0030.00318.32
8.0.270.0050.00316.88
8.0.260.0060.00017.16
8.0.250.0000.00717.03
8.0.240.0030.00316.91
8.0.230.0050.00216.96
8.0.220.0030.00716.97
8.0.210.0030.00316.92
8.0.200.0000.00816.89
8.0.190.0060.00316.95
8.0.180.0000.00717.01
8.0.170.0040.00416.93
8.0.160.0000.00716.93
8.0.150.0040.00416.86
8.0.140.0030.00516.88
8.0.130.0000.00513.41
8.0.120.0030.00516.93
8.0.110.0060.00316.79
8.0.100.0070.00016.75
8.0.90.0000.00716.88
8.0.80.0030.01216.98
8.0.70.0040.00416.73
8.0.60.0000.00816.99
8.0.50.0040.00416.93
8.0.30.0100.00916.95
8.0.20.0080.01417.40
8.0.10.0050.00316.95
8.0.00.0080.01216.88
7.4.330.0040.00415.03
7.4.320.0060.00016.52
7.4.300.0000.00616.63
7.4.290.0040.00416.61
7.4.280.0040.00416.42
7.4.270.0030.00316.53
7.4.260.0000.00716.58
7.4.250.0000.00816.58
7.4.240.0000.00716.47
7.4.230.0030.00316.26
7.4.220.0100.01416.38
7.4.210.0070.01316.60
7.4.200.0030.00316.58
7.4.160.0130.00716.51
7.4.150.0030.01517.40
7.4.140.0090.01217.86
7.4.130.0120.00816.54
7.4.120.0090.00816.64
7.4.110.0120.00916.62
7.4.100.0140.00616.45
7.4.90.0100.00716.48
7.4.80.0120.00819.39
7.4.70.0100.00716.68
7.4.60.0060.01016.27
7.4.50.0000.00616.42
7.4.40.0070.01016.55
7.4.30.0040.01316.55
7.4.00.0080.00914.95
7.3.330.0000.00613.45
7.3.320.0050.00013.41
7.3.310.0030.00516.33
7.3.300.0030.00316.29
7.3.290.0040.00416.44
7.3.280.0090.01016.44
7.3.270.0090.00917.40
7.3.260.0100.01016.75
7.3.240.0140.01016.49
7.3.230.0140.00916.54
7.3.210.0070.01016.54
7.3.200.0060.01316.55
7.3.190.0030.01816.39
7.3.180.0100.00616.60
7.3.170.0090.00916.74
7.3.160.0040.01216.61
7.3.120.0100.00714.95
7.3.110.0040.01214.90
7.3.100.0060.00714.85
7.3.90.0020.01314.87
7.3.80.0070.00714.72
7.3.70.0070.00614.78
7.3.60.0070.00714.76
7.3.50.0050.00714.86
7.3.40.0070.00614.82
7.3.30.0050.00514.68
7.3.20.0080.00516.77
7.3.10.0070.00616.67
7.3.00.0110.00316.61
7.2.330.0180.00316.61
7.2.320.0100.00716.82
7.2.310.0090.00916.75
7.2.300.0180.00616.71
7.2.290.0100.01116.53
7.2.250.0030.01315.12
7.2.240.0080.00814.86
7.2.230.0080.00715.10
7.2.220.0070.00915.03
7.2.210.0070.00914.90
7.2.200.0030.00914.97
7.2.190.0080.00815.08
7.2.180.0060.01115.06
7.2.170.0050.00915.09
7.2.160.0100.00615.00
7.2.150.0060.01316.84
7.2.140.0100.00017.04
7.2.130.0000.01417.03
7.2.120.0120.00616.68
7.2.110.0090.00617.00
7.2.100.0060.01117.07
7.2.90.0040.01116.88
7.2.80.0060.01017.02
7.2.70.0040.01417.02
7.2.60.0080.00617.02
7.2.50.0030.01416.71
7.2.40.0070.00716.80
7.2.30.0080.00417.02
7.2.20.0040.01216.99
7.2.10.0030.01217.13
7.2.00.0140.00316.98
7.1.330.0070.00615.79
7.1.320.0060.00615.91
7.1.310.0030.01215.73
7.1.300.0050.00815.45
7.1.290.0060.00615.53
7.1.280.0050.01015.86
7.1.270.0050.00615.63
7.1.260.0050.01015.82
7.1.250.0070.01115.66
7.1.200.0040.00415.67
7.1.70.0000.00917.11
7.1.60.0110.01419.38
7.1.50.0090.00916.95
7.1.00.0100.07022.50
7.0.200.0030.00616.88
7.0.60.0030.05719.93
7.0.50.0100.07717.92
7.0.40.0070.08320.11
7.0.30.0430.04320.24
7.0.20.0300.04720.22
7.0.10.0170.07020.26
7.0.00.0100.08720.23
5.6.280.0100.06720.97
5.6.210.0000.04720.55
5.6.200.0030.04318.25
5.6.190.0030.04320.55
5.6.180.0370.06320.62
5.6.170.0300.07720.45
5.6.160.0070.07720.47
5.6.150.0100.07018.21
5.6.140.0100.04318.23
5.6.130.0130.08018.25
5.6.120.0100.07721.03
5.6.110.0100.05721.10
5.6.100.0170.07020.95
5.6.90.0100.08321.04
5.6.80.0030.08320.49
5.5.350.0370.06720.42
5.5.340.0030.07317.98
5.5.330.0030.05020.40
5.5.320.0430.06020.24
5.5.310.0130.04320.51
5.5.300.0070.07318.05
5.5.290.0070.06317.95
5.5.280.0000.05320.81
5.5.270.0130.07320.74
5.5.260.0100.08320.74
5.5.250.0070.08320.67
5.5.240.3900.04720.18
5.4.450.0100.05019.48
5.4.440.0770.05019.66
5.4.430.1170.05319.55
5.4.420.0200.04719.52
5.4.410.0030.06019.52
5.4.400.0070.05319.25
5.4.390.0100.05018.98
5.4.380.0130.06319.16
5.4.370.0030.07719.06
5.4.360.0030.05719.11
5.4.350.0170.04719.25
5.4.340.0030.06019.16
5.4.320.0100.05319.22
5.4.310.0070.05319.21
5.4.300.0100.05019.16
5.4.290.0200.04018.98
5.4.280.0000.06019.11
5.4.270.0070.05719.25
5.4.260.0100.05019.20
5.4.250.0000.06319.12
5.4.240.0070.06319.07
5.4.230.0170.06319.14
5.4.220.0170.06719.24
5.4.210.0170.05719.05
5.4.200.0200.04317.05
5.4.190.0170.04719.02
5.4.180.0100.05319.00
5.4.170.0100.06019.00
5.4.160.0030.05718.96
5.4.150.0000.06019.13
5.4.140.0100.05316.61
5.4.130.0100.05016.42
5.4.120.0100.04716.42
5.4.110.0070.05016.26
5.4.100.0030.06016.50
5.4.90.0100.05016.30
5.4.80.0070.05016.46
5.4.70.0030.06016.46
5.4.60.0030.05716.55
5.4.50.0200.05016.54
5.4.40.0100.05716.23
5.4.30.0100.04716.23
5.4.20.0070.05316.55
5.4.10.0070.05316.63
5.4.00.0070.05015.80
5.3.290.0030.06014.72
5.3.280.0030.05714.65
5.3.270.0130.05014.55
5.3.260.0130.05014.68
5.3.250.0100.05014.67
5.3.240.0030.05714.62
5.3.230.0130.04714.52
5.3.220.0130.04714.66
5.3.210.0100.05014.59
5.3.200.0130.04714.61
5.3.190.0130.05014.58
5.3.180.0200.06014.72
5.3.170.0130.04714.48
5.3.160.0130.04714.65
5.3.150.0130.04714.51
5.3.140.0030.05714.55
5.3.130.0100.05314.42
5.3.120.0070.05714.52
5.3.110.0070.05714.63
5.3.100.0030.05714.06
5.3.90.0130.04713.99
5.3.80.0030.05713.94
5.3.70.0030.05714.14
5.3.60.0070.05713.92
5.3.50.0130.04713.92
5.3.40.0130.04713.96
5.3.30.0070.05013.90
5.3.20.0130.04713.72
5.3.10.0030.05313.66
5.3.00.0070.05713.56
5.2.170.0100.04710.99
5.2.160.0030.04311.10
5.2.150.0100.04011.11
5.2.140.0100.04311.13
5.2.130.0070.04311.20
5.2.120.0030.04711.23
5.2.110.0070.04011.08
5.2.100.0030.04311.18
5.2.90.0070.04011.08
5.2.80.0030.04311.11
5.2.70.0030.04711.02
5.2.60.0100.03711.00
5.2.50.0030.04710.89
5.2.40.0030.04711.09
5.2.30.0030.04710.91
5.2.20.0030.04310.93
5.2.10.0070.04010.78
5.2.00.0070.04010.73
5.1.60.0070.03310.10
5.1.50.0000.04010.01
5.1.40.0100.03010.00
5.1.30.0100.03310.42
5.1.20.0030.04010.43
5.1.10.0170.02710.23
5.1.00.0000.04010.18
5.0.50.0030.0308.65
5.0.40.0100.0238.57
5.0.30.0070.0478.12
5.0.20.0130.0208.36
5.0.10.0030.0308.19
5.0.00.0000.0478.18
4.4.90.0030.0205.86
4.4.80.0000.0235.83
4.4.70.0000.0275.89
4.4.60.0030.0205.89
4.4.50.0030.0205.93
4.4.40.0030.0405.89
4.4.30.0030.0235.75
4.4.20.0000.0235.84
4.4.10.0000.0235.83
4.4.00.0030.0335.86
4.3.110.0070.0205.67
4.3.100.0000.0235.75
4.3.90.0030.0205.65
4.3.80.0000.0375.75
4.3.70.0030.0205.77
4.3.60.0030.0205.77
4.3.50.0000.0275.79
4.3.40.0070.0305.76
4.3.30.0000.0234.41
4.3.20.0000.0304.43
4.3.10.0030.0234.45
4.3.00.0030.01315.57

preferences:
53.08 ms | 401 KiB | 5 Q