3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ErrorLog { var $errorArr = array(); function throwError ($err, $level = E_USER_WARNING, $suppress = false, $shiftBack = 1) { // Shiftback means: look back into the backtrace calls, shifting that amount of calls, and then report the error. // There is no checking whether this many levels actually exist in the call stack, make sure yourself // Error log doesn't show newlines. str_replace( array( "\n" ), array( " " ), $err ); $trace = ErrorLog::getBacktrace(); $info = ""; if (!empty($trace)) { while ($shiftBack > 0) { array_shift($trace); --$shiftBack; } // Error file/line information: $info .= "in " . $trace[0]["file"] . ":" . $trace[0]["line"] . "."; // Caller information: if (count($trace) > 1) { array_shift($trace); $caller = $trace[0]; $info .= " Thrown by "; if (isset($caller["function"])) { if (isset($caller["class"])) { $info .= $caller["class"] . "::"; } $info .= $caller["function"] . "() "; } else { $info .= "global scope "; } $info .= "which was called in " . $caller["file"] . ":" . $caller["line"] . "."; } } $out = "\"" . $err . "\" " . $info; if (!$suppress) { trigger_error($out, $level); } } function throwDeprecated ($suppress = false) { // Call this method from INSIDE a deprecated function, ErrorLog::throwError("Deprecated!", E_USER_NOTICE, $suppress, 2); } function getBacktrace () { if (version_compare(PHP_VERSION, "5.2.5", "<")) { return debug_backtrace(); } else { return debug_backtrace(false); // A bit more efficient } } } function a () { ErrorLog::throwDeprecated(); } a();

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.40.0110.00418.59
8.3.30.0060.01518.84
8.3.20.0000.00818.79
8.3.10.0060.00320.57
8.3.00.0030.00521.77
8.2.170.0090.00622.96
8.2.160.0100.00320.39
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0040.00419.23
8.2.110.0030.00721.04
8.2.100.0040.00817.78
8.2.90.0030.00519.05
8.2.80.0040.00417.97
8.2.70.0030.00717.50
8.2.60.0050.00317.90
8.2.50.0040.00418.07
8.2.40.0040.00818.16
8.2.30.0040.00419.78
8.2.20.0000.00717.79
8.2.10.0030.00517.62
8.2.00.0030.00517.70
8.1.270.0050.00323.99
8.1.260.0130.00326.35
8.1.250.0100.00028.09
8.1.240.0100.00022.29
8.1.230.0070.00420.97
8.1.220.0040.00418.77
8.1.210.0000.00818.81
8.1.200.0030.00617.23
8.1.190.0080.00017.41
8.1.180.0030.00618.10
8.1.170.0050.00318.56
8.1.160.0070.00018.71
8.1.150.0050.00218.49
8.1.140.0040.00417.29
8.1.130.0030.00317.79
8.1.120.0040.00417.24
8.1.110.0000.00817.35
8.1.100.0030.00517.25
8.1.90.0040.00417.36
8.1.80.0000.00817.41
8.1.70.0000.00717.25
8.1.60.0030.00617.54
8.1.50.0040.00417.26
8.1.40.0040.00417.52
8.1.30.0060.00317.63
8.1.20.0000.00817.59
8.1.10.0050.00317.50
8.1.00.0000.00917.36
8.0.300.0040.00419.90
8.0.290.0000.00816.75
8.0.280.0000.00718.39
8.0.270.0030.00317.17
8.0.260.0000.00816.84
8.0.250.0030.00616.88
8.0.240.0000.01116.99
8.0.230.0000.00716.98
8.0.220.0030.00316.80
8.0.210.0000.00716.93
8.0.200.0000.00616.86
8.0.190.0030.00616.89
8.0.180.0000.00716.89
8.0.170.0030.00516.95
8.0.160.0070.00016.88
8.0.150.0080.00016.81
8.0.140.0000.00716.87
8.0.130.0080.00013.33
8.0.120.0040.00416.91
8.0.110.0070.00016.78
8.0.100.0030.00516.79
8.0.90.0040.00416.75
8.0.80.0030.01316.80
8.0.70.0000.00816.78
8.0.60.0070.00016.72
8.0.50.0080.00016.84
8.0.30.0100.01017.13
8.0.20.0180.00917.40
8.0.10.0000.00716.77
8.0.00.0080.01216.74
7.4.330.0020.00214.86
7.4.320.0060.00016.53
7.4.300.0000.00616.66
7.4.290.0040.00416.52
7.4.280.0040.00416.49
7.4.270.0030.00316.65
7.4.260.0030.00313.31
7.4.250.0050.00316.62
7.4.240.0040.00416.60
7.4.230.0030.00316.59
7.4.220.0120.00916.50
7.4.210.0050.01016.56
7.4.200.0000.00716.60
7.4.190.0070.00016.71
7.4.160.0100.01016.54
7.4.150.0060.01217.40
7.4.140.0110.00817.86
7.4.130.0140.00616.57
7.4.120.0120.00616.60
7.4.110.0030.01516.40
7.4.100.0100.00616.67
7.4.90.0180.00016.68
7.4.80.0150.01019.37
7.4.70.0120.00916.53
7.4.60.0040.01216.20
7.4.50.0040.00416.75
7.4.40.0090.00922.27
7.4.30.0100.01016.58
7.4.00.0070.00715.22
7.3.330.0020.00213.53
7.3.320.0030.00313.38
7.3.310.0030.00316.28
7.3.300.0040.00416.41
7.3.290.0030.01016.43
7.3.280.0060.01016.47
7.3.270.0160.00917.40
7.3.260.0090.00918.24
7.3.250.0100.00916.51
7.3.240.0100.00716.73
7.3.230.0080.00816.64
7.3.210.0100.00716.44
7.3.200.0110.00719.39
7.3.190.0140.00316.47
7.3.180.0000.01616.55
7.3.170.0060.01016.59
7.3.160.0000.01616.59
7.3.120.0060.00815.00
7.3.10.0090.00616.75
7.3.00.0070.01016.69
7.2.330.0120.00616.72
7.2.320.0120.00416.44
7.2.310.0060.01616.84
7.2.300.0100.01416.81
7.2.290.0090.00916.57
7.2.130.0040.01516.69
7.2.120.0030.01216.69
7.2.110.0090.00616.97
7.2.100.0030.01016.85
7.2.90.0090.00617.12
7.2.80.0070.00417.02
7.2.70.0100.00316.85
7.2.60.0100.00616.98
7.2.50.0080.00817.03
7.2.40.0040.01416.96
7.2.30.0070.01017.12
7.2.20.0090.00616.94
7.2.10.0070.00716.83
7.2.00.0050.00918.32
7.1.250.0100.00315.86
7.1.200.0020.00715.81
7.1.100.0100.00318.11
7.1.70.0030.01017.17
7.1.60.0110.01119.40
7.1.50.0030.01017.10
7.1.00.0000.08022.50
7.0.200.0060.00616.76
7.0.140.0030.07322.01
7.0.60.0130.07319.80
7.0.50.0070.04717.88
7.0.40.0030.05317.75
7.0.30.0070.08317.79
7.0.20.0100.06317.81
7.0.10.0070.08317.78
7.0.00.0130.05717.80
5.6.280.0000.07320.91
5.6.210.0200.06320.50
5.6.200.0130.07718.14
5.6.190.0100.08318.16
5.6.180.0070.08318.14
5.6.170.0070.07018.19
5.6.160.0030.05018.18
5.6.150.0070.07718.24
5.6.140.0130.06718.21
5.6.130.0130.03318.17
5.6.120.0100.06718.13
5.6.110.0100.06018.15
5.6.100.0130.05318.16
5.6.90.0070.08018.27
5.6.80.0030.08317.57
5.6.70.0100.06717.56
5.6.60.0100.06317.53
5.6.50.0100.07317.66
5.6.40.0170.05017.60
5.6.30.0070.07017.64
5.6.20.0070.07717.64
5.6.10.0130.06017.54
5.6.00.0070.06017.63
5.5.350.0330.07020.32
5.5.340.0030.06317.99
5.5.330.0030.05017.96
5.5.320.0100.05718.08
5.5.310.0130.04718.08
5.5.300.0070.05017.95
5.5.290.0100.08317.96
5.5.280.0070.05017.96
5.5.270.0100.08318.01
5.5.260.0030.08318.05
5.5.250.0130.07017.78
5.5.240.0070.08317.44
5.5.230.0030.08017.32
5.5.220.0200.05017.35
5.5.210.0000.05717.36
5.5.200.0030.08017.34
5.5.190.0100.06317.34
5.5.180.0070.07717.34
5.5.160.0030.04717.34
5.5.150.0200.06317.34
5.5.140.0100.07717.42
5.5.130.0070.03717.36
5.5.120.0070.07717.29
5.5.110.0130.03017.33
5.5.100.0070.07317.26
5.5.90.0130.07017.21
5.5.80.0130.05317.21
5.5.70.0030.08317.20
5.5.60.0130.07017.22
5.5.50.0070.07717.30
5.5.40.0000.08017.20
5.5.30.0100.04017.17
5.5.20.0030.08017.18
5.5.10.0070.04017.15
5.5.00.0130.07017.28
5.4.450.0030.05719.37
5.4.440.0030.07719.36
5.4.430.0100.07319.34
5.4.420.0100.06019.30
5.4.410.0170.04319.29
5.4.400.0030.06718.99
5.4.390.0070.08019.27
5.4.380.0170.05718.98
5.4.370.0030.07019.27
5.4.360.0130.06019.04
5.4.350.0130.06319.27
5.4.340.0070.04719.02
5.4.320.0170.06719.06
5.4.310.0070.07718.98
5.4.300.0100.07019.12
5.4.290.0070.04019.05
5.4.280.0070.07319.27
5.4.270.0170.03019.03
5.4.260.0130.07018.95
5.4.250.0100.07719.05
5.4.240.0070.07019.08
5.4.230.0130.07319.01
5.4.220.0130.07319.11
5.4.210.0030.08319.13
5.4.200.0070.07319.04
5.4.190.0070.05319.05
5.4.180.0070.04718.98
5.4.170.0130.04019.08
5.4.160.0030.05318.98
5.4.150.0100.07718.87
5.4.140.0100.07316.46
5.4.130.0030.06316.47
5.4.120.0100.04716.51
5.4.110.0070.07716.29
5.4.100.0070.04316.51
5.4.90.0030.05716.54
5.4.80.0030.07716.42
5.4.70.0030.05016.44
5.4.60.0070.07316.39
5.4.50.0030.05016.29
5.4.40.0130.06716.41
5.4.30.0170.06016.30
5.4.20.0070.05716.41
5.4.10.0100.06316.43
5.4.00.0070.07315.86
5.3.290.0070.05014.55
5.3.280.0070.07314.83
5.3.270.0070.03714.48
5.3.260.0170.06714.75
5.3.250.0100.07314.66
5.3.240.0170.06714.73
5.3.230.0130.06714.66
5.3.220.0070.06014.61
5.3.210.0130.07314.45
5.3.200.0130.05314.44
5.3.190.0030.07714.66
5.3.180.0100.04714.58
5.3.170.0070.07014.62
5.3.160.0070.04314.63
5.3.150.0070.07014.66
5.3.140.0170.06714.61
5.3.130.0030.06314.64
5.3.120.0030.06714.56
5.3.110.0030.06714.63
5.3.100.0100.06313.91
5.3.90.0100.07314.02
5.3.80.0100.05714.24
5.3.70.0030.04714.07
5.3.60.0200.06714.23
5.3.50.0070.06713.81
5.3.40.0070.07314.06
5.3.30.0130.07013.98
5.3.20.0100.07013.74
5.3.10.0070.06713.72
5.3.00.0070.07013.70
5.2.170.0030.04311.20
5.2.160.0100.04711.17
5.2.150.0000.06311.18
5.2.140.0130.05011.26
5.2.130.0030.06311.14
5.2.120.0000.05311.12
5.2.110.0030.05711.03
5.2.100.0070.04711.18
5.2.90.0070.06011.13
5.2.80.0000.04711.08
5.2.70.0000.05711.02
5.2.60.0100.06011.11
5.2.50.0030.06011.02
5.2.40.0070.04010.99
5.2.30.0030.03711.09
5.2.20.0030.06711.02
5.2.10.0030.05710.92
5.2.00.0030.06010.75
5.1.60.0030.04710.12
5.1.50.0070.03010.12
5.1.40.0030.04010.21
5.1.30.0000.04710.35
5.1.20.0000.03710.38
5.1.10.0000.03310.03
5.1.00.0030.04710.30
5.0.50.0030.0508.86
5.0.40.0030.0378.86
5.0.30.0000.0578.86
5.0.20.0000.0378.86
5.0.10.0030.0478.86
5.0.00.0000.0578.86
4.4.90.0030.0378.86
4.4.80.0000.0378.86
4.4.70.0000.0338.86
4.4.60.0000.0338.86
4.4.50.0000.0408.86
4.4.40.0000.0438.86
4.4.30.0030.0378.86
4.4.20.0030.0378.86
4.4.10.0000.0238.86
4.4.00.0000.0508.86
4.3.110.0030.0338.86
4.3.100.0030.0338.86
4.3.90.0030.0308.86
4.3.80.0000.0608.86
4.3.70.0070.0308.86
4.3.60.0070.0278.86
4.3.50.0000.0378.86
4.3.40.0030.0408.86
4.3.30.0030.0378.86
4.3.20.0000.0408.86
4.3.10.0000.0278.86
4.3.00.0000.0308.86

preferences:
52.72 ms | 400 KiB | 5 Q