3v4l.org

run code in 300+ PHP versions simultaneously
<?php $errorTypes = [ E_ERROR => 'Error', E_WARNING => 'Warning', E_PARSE => 'Parse Error', E_NOTICE => 'Notice', E_CORE_ERROR => 'Core Error', E_CORE_WARNING => 'Core Warning', E_COMPILE_ERROR => 'Compile Error', E_COMPILE_WARNING => 'Compile Warning', E_USER_ERROR => 'User Error', E_USER_WARNING => 'User Warning', E_USER_NOTICE => 'User Notice', E_USER_DEPRECATED => 'Deprecated', E_STRICT => 'Strict Standards', E_RECOVERABLE_ERROR => 'Catchable Fatal' ]; $fatalErrorTypes = [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR, E_RECOVERABLE_ERROR]; function log_error($num, $str, $file, $line, $context = null, $exit = true) { global $errorTypes; global $fatalErrorTypes; $bFatal = true; if (isset($errorTypes[$num])) { $errType = $errorTypes[$num]; $bFatal = in_array($num, $fatalErrorTypes); } else { $errType = "Unknown error #$num"; } // would normally record stuff here echo "PHP $errType [$file:$line]: $str\n"; if ($bFatal && $exit) { die; } } function check_for_fatal() { global $fatalErrorTypes; $error = error_get_last(); if (in_array($error['type'], $fatalErrorTypes)) { log_error($error["type"], $error["message"], $error["file"], $error["line"], null, false); $output = '{"errors":[{"code":"internal_server_error"}]}'; // would normally record stuff here echo $output; } } function log_exception(\Exception $e) { echo get_class($e) . ': ' . $e->getMessage(); } register_shutdown_function('check_for_fatal'); set_error_handler('log_error'); set_exception_handler('log_exception'); try { $broken = null; echo $broken->length(); } catch (\Exception $e) { log_exception($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.0060.00818.40
8.3.50.0070.01222.08
8.3.40.0120.00318.70
8.3.30.0070.00719.20
8.3.20.0060.01220.33
8.3.10.0070.01123.66
8.3.00.0100.01019.57
8.2.180.0140.00417.13
8.2.170.0120.00322.96
8.2.160.0030.01020.35
8.2.150.0040.00424.18
8.2.140.0090.00324.66
8.2.130.0080.00026.16
8.2.120.0080.00020.80
8.2.110.0000.00922.30
8.2.100.0070.00419.64
8.2.90.0000.00819.41
8.2.80.0000.00919.31
8.2.70.0050.00317.63
8.2.60.0140.00017.93
8.2.50.0040.00418.07
8.2.40.0030.00618.28
8.2.30.0000.00918.11
8.2.20.0000.00817.89
8.2.10.0000.00918.02
8.2.00.0040.00417.81
8.1.280.0140.00425.92
8.1.270.0060.00324.66
8.1.260.0030.00626.35
8.1.250.0020.00528.09
8.1.240.0100.01023.86
8.1.230.0040.00819.10
8.1.220.0080.00017.78
8.1.210.0000.00818.77
8.1.200.0040.00417.35
8.1.190.0000.00817.53
8.1.180.0050.00319.13
8.1.170.0030.00518.57
8.1.160.0050.00222.21
8.1.150.0000.00718.96
8.1.140.0040.00417.34
8.1.130.0050.00217.84
8.1.120.0000.00717.51
8.1.110.0070.00017.48
8.1.100.0040.00417.48
8.1.90.0000.00717.51
8.1.80.0050.00317.40
8.1.70.0030.00317.34
8.1.60.0040.00417.62
8.1.50.0030.00517.51
8.1.40.0040.00417.48
8.1.30.0040.00417.59
8.1.20.0040.00417.60
8.1.10.0030.00617.59
8.1.00.0040.00417.49
8.0.300.0060.00318.77
8.0.290.0040.00417.16
8.0.280.0070.00018.53
8.0.270.0000.00717.15
8.0.260.0000.00717.16
8.0.250.0000.00716.96
8.0.240.0000.00617.05
8.0.230.0000.00717.05
8.0.220.0040.00416.85
8.0.210.0040.00416.97
8.0.200.0030.00516.92
8.0.190.0060.00317.02
8.0.180.0080.00016.93
8.0.170.0040.00417.00
8.0.160.0080.00016.91
8.0.150.0070.00016.83
8.0.140.0040.00416.86
8.0.130.0030.00313.50
8.0.120.0080.00016.82
8.0.110.0060.00316.93
8.0.100.0040.00417.00
8.0.90.0000.00816.92
8.0.80.0060.01316.95
8.0.70.0050.00316.78
8.0.60.0030.00516.80
8.0.50.0040.00416.99
8.0.30.0140.00717.27
8.0.20.0090.01017.40
8.0.10.0040.00417.13
8.0.00.0070.01216.83
7.4.330.0030.00315.03
7.4.320.0000.00716.63
7.4.300.0000.00716.54
7.4.290.0040.00416.52
7.4.280.0030.00316.63
7.4.270.0040.00416.45
7.4.260.0090.00016.49
7.4.250.0000.00716.49
7.4.240.0040.00416.54
7.4.230.0070.00016.50
7.4.220.0090.00916.40
7.4.210.0120.00616.56
7.4.200.0040.00416.60
7.4.160.0120.00416.74
7.4.150.0090.00917.40
7.4.140.0110.00617.86
7.4.130.0050.01516.57
7.4.120.0100.00816.46
7.4.110.0100.00716.60
7.4.100.0090.00816.67
7.4.90.0100.00716.47
7.4.80.0080.01119.39
7.4.70.0100.01016.59
7.4.60.0100.00616.47
7.4.50.0080.00016.50
7.4.40.0090.00916.44
7.4.30.0080.00816.39
7.4.00.0060.01115.09
7.3.330.0030.00313.32
7.3.320.0000.00513.32
7.3.310.0000.00716.55
7.3.300.0070.00016.45
7.3.290.0070.00716.44
7.3.280.0100.00816.44
7.3.270.0120.00617.40
7.3.260.0100.00716.38
7.3.250.0090.00916.69
7.3.240.0070.01016.26
7.3.230.0110.00616.39
7.3.210.0060.01216.46
7.3.200.0120.00619.39
7.3.190.0130.00316.46
7.3.180.0160.00016.36
7.3.170.0060.01016.52
7.3.160.0100.00716.44
7.3.120.0070.01114.91
7.3.110.0100.00814.71
7.3.100.0090.00914.84
7.3.90.0060.00715.01
7.3.80.0040.01014.98
7.3.70.0040.00614.92
7.3.60.0030.01215.01
7.3.50.0080.00514.95
7.3.40.0060.00414.93
7.3.30.0060.00714.86
7.3.20.0060.00816.73
7.3.10.0060.00616.74
7.3.00.0040.01216.52
7.2.330.0030.01316.77
7.2.320.0030.01316.43
7.2.310.0120.00816.82
7.2.300.0000.01716.77
7.2.290.0030.01416.57
7.2.250.0060.00915.23
7.2.240.0070.01315.20
7.2.230.0080.00815.30
7.2.220.0040.01315.15
7.2.210.0080.00815.14
7.2.200.0030.00814.83
7.2.190.0060.00915.10
7.2.180.0030.00815.13
7.2.170.0030.01014.96
7.2.160.0060.00914.93
7.2.150.0030.00617.02
7.2.140.0040.01116.81
7.2.130.0040.01416.96
7.2.120.0030.01316.91
7.2.110.0030.01317.08
7.2.100.0030.01016.99
7.2.90.0090.00317.23
7.2.80.0050.00816.80
7.2.70.0060.01017.00
7.2.60.0030.01016.95
7.2.50.0070.00717.11
7.2.40.0050.00517.02
7.2.30.0060.00917.11
7.2.20.0130.00616.84
7.2.10.0040.01117.10
7.2.00.0020.01118.33
7.1.330.0050.01015.87
7.1.320.0060.00615.75
7.1.310.0030.01115.80
7.1.300.0060.00515.74
7.1.290.0050.00615.66
7.1.280.0090.00515.90
7.1.270.0050.01015.86
7.1.260.0080.00715.71
7.1.250.0100.00315.90
7.1.240.0030.01015.63
7.1.230.0060.00915.93
7.1.220.0100.00315.86
7.1.210.0000.01415.98
7.1.200.0030.00815.63
7.1.190.0120.00315.75
7.1.180.0080.00015.76
7.1.170.0100.00615.75
7.1.160.0030.00715.80
7.1.150.0070.00715.90
7.1.140.0040.00715.80
7.1.130.0060.00615.94
7.1.120.0090.00615.93
7.1.110.0090.00615.91
7.1.100.0060.00616.78
7.1.90.0040.00415.96
7.1.80.0100.00316.04
7.1.70.0090.00716.59
7.1.60.0080.01017.38
7.1.50.0120.00716.26
7.1.40.0030.00915.54
7.1.30.0040.00815.76
7.1.20.0030.00615.68
7.1.10.0100.00315.79
7.1.00.0070.04519.09
7.0.330.0060.00615.51
7.0.320.0110.00315.30
7.0.310.0070.00315.44
7.0.300.0110.00415.49
7.0.290.0040.00815.52
7.0.280.0100.00315.35
7.0.270.0040.00415.26
7.0.260.0100.00315.52
7.0.250.0060.00915.38
7.0.240.0000.00915.50
7.0.230.0040.00415.54
7.0.220.0090.00615.33
7.0.210.0000.01315.62
7.0.200.0000.00916.07
7.0.190.0040.01215.50
7.0.180.0070.00715.39
7.0.170.0040.00415.21
7.0.160.0060.01015.56
7.0.150.0060.00915.26
7.0.140.0030.03218.76
7.0.130.0000.00815.36
7.0.120.0030.00915.29
7.0.110.0030.00915.56
7.0.100.0030.00615.23
7.0.90.0070.00715.53
7.0.80.0040.01115.29
7.0.70.0050.00515.70
7.0.60.0080.04417.69
7.0.50.0070.04216.66
7.0.40.0060.04416.91
7.0.30.0130.04416.83
7.0.20.0170.03916.92
7.0.10.0050.02616.81
7.0.00.0060.04616.89
5.6.400.0070.00714.37
5.6.390.0060.00614.25
5.6.380.0030.01014.65
5.6.370.0070.00714.26
5.6.360.0120.00314.38
5.6.350.0090.00614.34
5.6.340.0030.00614.40
5.6.330.0030.00614.17
5.6.320.0070.00314.27
5.6.310.0040.00714.26
5.6.300.0070.00414.35
5.6.290.0060.00614.50
5.6.280.0030.04417.79
5.6.270.0060.00614.63
5.6.260.0060.00614.68
5.6.250.0070.00714.56
5.6.240.0000.01114.45
5.6.230.0030.01014.57
5.6.220.0060.00614.61
5.6.210.0080.04217.61
5.6.200.0070.04816.25
5.6.190.0030.05117.64
5.6.180.0280.03717.48
5.6.170.0110.02817.43
5.6.160.0080.03817.36
5.6.150.0070.04316.32
5.6.140.0030.04616.33
5.6.130.0020.02916.29
5.6.120.0100.04217.66
5.6.110.0090.02517.76
5.6.100.0120.03817.66
5.6.90.0070.04717.70
5.6.80.0050.03217.46
5.6.70.0120.00414.11
5.6.60.0000.01114.26
5.6.50.0070.00714.07
5.6.40.0030.01014.56
5.6.30.0060.00614.41
5.6.20.0090.00614.50
5.6.10.0040.00714.36
5.6.00.0030.01014.27
5.5.380.0030.00614.42
5.5.370.0030.00614.17
5.5.360.0070.00314.45
5.5.350.0240.03317.47
5.5.340.0060.02616.25
5.5.330.0070.04217.28
5.5.320.0170.04817.46
5.5.310.0190.03317.14
5.5.300.0050.04516.19
5.5.290.0020.03316.11
5.5.280.0100.04317.59
5.5.270.0020.02817.48
5.5.260.0030.02917.44
5.5.250.0050.04017.24
5.5.240.0080.04217.34
5.5.230.0100.00614.18
5.5.220.0000.01314.10
5.5.210.0030.00614.34
5.5.200.0090.00614.39
5.5.190.0030.00614.10
5.5.180.0100.00314.09
5.5.170.0060.00614.38
5.5.160.0100.00314.52
5.5.150.0120.00014.34
5.5.140.0030.00713.84
5.5.130.0060.00314.50
5.5.120.0110.00314.45
5.5.110.0030.01414.47
5.5.100.0070.01013.91
5.5.90.0040.01414.42
5.5.80.0070.00713.81
5.5.70.0060.00614.20
5.5.60.0040.00414.14
5.5.50.0090.00314.18
5.5.40.0030.00613.85
5.5.30.0050.00414.24
5.5.20.0000.01214.39
5.5.10.0060.00314.42
5.5.00.0100.00313.94
5.4.450.0050.03216.43
5.4.440.0150.04116.52
5.4.430.0150.03616.51
5.4.420.0070.02816.52
5.4.410.0100.02616.42
5.4.400.0150.02016.27
5.4.390.0180.03516.27
5.4.380.0170.01916.38
5.4.370.0080.02716.35
5.4.360.0170.02216.32
5.4.350.0150.03516.20
5.4.340.0120.04416.39
5.4.330.0030.00713.55
5.4.320.0140.03116.32
5.4.310.0220.03616.41
5.4.300.0150.02716.44
5.4.290.0130.03816.32
5.4.280.0110.04016.39
5.4.270.0210.03616.37
5.4.260.0170.02516.25
5.4.250.0130.03916.32
5.4.240.0150.02516.32
5.4.230.0190.01516.35
5.4.220.0130.03716.35
5.4.210.0150.03716.34
5.4.200.0100.02216.43
5.4.190.0080.03516.28
5.4.180.0110.02616.35
5.4.170.0150.04116.39
5.4.160.0110.03316.41
5.4.150.0170.03016.40
5.4.140.0120.02315.15
5.4.130.0130.02714.99
5.4.120.0140.03115.03
5.4.110.0170.02315.08
5.4.100.0150.03514.89
5.4.90.0150.02214.98
5.4.80.0150.02214.88
5.4.70.0130.02014.98
5.4.60.0060.03114.91
5.4.50.0140.03615.05
5.4.40.0100.03615.04
5.4.30.0130.03814.99
5.4.20.0170.03515.04
5.4.10.0120.03815.04
5.4.00.0140.03714.75
5.3.290.0230.07714.50
5.3.280.0130.08014.54
5.3.270.0130.04714.57
5.3.260.0170.06014.55
5.3.250.0200.06314.48
5.3.240.0230.04714.64
5.3.230.0300.07014.65
5.3.220.0100.05314.42
5.3.210.0230.06014.52
5.3.200.0300.05714.42
5.3.190.0200.03714.43
5.3.180.0200.05714.51
5.3.170.0170.04014.40
5.3.160.0230.07314.52
5.3.150.0270.08014.41
5.3.140.0270.06714.59
5.3.130.0270.07314.53
5.3.120.0330.06314.61
5.3.110.0270.06314.39
5.3.100.0270.06713.99
5.3.90.0270.07013.93
5.3.80.0200.07313.86
5.3.70.0270.06013.90
5.3.60.0270.06713.91
5.3.50.0200.04013.89
5.3.40.0170.05713.85
5.3.30.0200.06313.86
5.3.20.0200.06313.53
5.3.10.0270.06313.60
5.3.00.0170.07713.47
5.2.170.0130.04012.40
5.2.160.0200.05712.40
5.2.150.0170.04312.40
5.2.140.0270.04712.40
5.2.130.0230.05712.40
5.2.120.0230.04012.40
5.2.110.0230.05312.40
5.2.100.0230.05312.40
5.2.90.0200.05712.40
5.2.80.0200.04712.40
5.2.70.0170.04012.40
5.2.60.0200.03712.40
5.2.50.0270.05312.40
5.2.40.0130.04312.40
5.2.30.0200.03312.40
5.2.20.0130.06012.40
5.2.10.0200.05312.40
5.2.00.0170.06012.40
5.1.60.0200.04712.40
5.1.50.0130.03312.40
5.1.40.0230.04712.40
5.1.30.0230.04712.40
5.1.20.0270.03312.40
5.1.10.0200.04712.40
5.1.00.0070.03012.40
5.0.50.0070.02712.40
5.0.40.0030.03712.40
5.0.30.0070.06012.40
5.0.20.0100.04312.40
5.0.10.0170.03312.40
5.0.00.0030.06712.40
4.4.90.0100.03312.40
4.4.80.0100.03312.40
4.4.70.0070.02012.40
4.4.60.0200.01312.40
4.4.50.0130.03012.40
4.4.40.0070.05312.40
4.4.30.0070.03712.40
4.4.20.0070.03012.40
4.4.10.0130.03012.40
4.4.00.0070.03012.40
4.3.110.0100.03012.40
4.3.100.0100.03312.40
4.3.90.0130.01712.40
4.3.80.0070.05012.40
4.3.70.0070.02712.40
4.3.60.0100.02712.40
4.3.50.0130.03012.40
4.3.40.0070.05312.40
4.3.30.0070.03312.40
4.3.20.0000.04012.40
4.3.10.0000.02312.40
4.3.00.0030.02312.40

preferences:
68.56 ms | 401 KiB | 5 Q