3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ErrorLog { /*public static*/ 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"] . "."; } } $queryStr = $_SERVER["QUERY_STRING"]; $info .= " (Called URL: " . $_SERVER["HOST_NAME"] . $_SERVER["PHP_SELF"] . (!empty($queryStr) ? ("?" . $queryStr) : "") . ")"; $out = "\"" . $err . "\" " . $info; if (!$suppress) { trigger_error($out, $level); } } /*public static*/ function throwDeprecated ($suppress = false) { // Call this method from INSIDE a deprecated function, ErrorLog::throwError("Deprecated!", E_USER_NOTICE, $suppress, 2); } /*private static*/ 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.60.0070.01116.88
8.3.50.0130.00518.36
8.3.40.0170.00018.80
8.3.30.0000.01618.85
8.3.20.0180.00018.88
8.3.10.0030.00618.69
8.3.00.0040.00419.50
8.2.180.0100.00616.63
8.2.170.0110.00422.96
8.2.160.0070.00718.91
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0090.00017.48
8.2.110.0070.00420.47
8.2.100.0080.00417.87
8.2.90.0000.00819.08
8.2.80.0000.00918.04
8.2.70.0000.00917.63
8.2.60.0000.00817.93
8.2.50.0030.00517.68
8.2.40.0040.00419.95
8.2.30.0040.00417.70
8.2.20.0080.00317.74
8.2.10.0000.00717.60
8.2.00.0030.00617.71
8.1.280.0090.00625.92
8.1.270.0090.00022.04
8.1.260.0030.00626.35
8.1.250.0000.00828.09
8.1.240.0080.00023.84
8.1.230.0080.00322.13
8.1.220.0090.00017.74
8.1.210.0040.00818.77
8.1.200.0090.00017.23
8.1.190.0040.00417.10
8.1.180.0030.00518.10
8.1.170.0040.00417.62
8.1.160.0000.00719.02
8.1.150.0000.00818.59
8.1.140.0050.00317.34
8.1.130.0000.00717.66
8.1.120.0070.00017.36
8.1.110.0040.00417.27
8.1.100.0000.00817.36
8.1.90.0040.00417.24
8.1.80.0040.00417.23
8.1.70.0080.00017.33
8.1.60.0000.00817.43
8.1.50.0030.00517.42
8.1.40.0060.00317.38
8.1.30.0030.00617.61
8.1.20.0060.00317.58
8.1.10.0000.00717.50
8.1.00.0090.00017.36
8.0.300.0090.00318.77
8.0.290.0030.00616.63
8.0.280.0030.00318.59
8.0.270.0070.00017.20
8.0.260.0050.00316.91
8.0.250.0110.00016.84
8.0.240.0040.00416.91
8.0.230.0030.00316.90
8.0.220.0070.00016.93
8.0.210.0040.00416.96
8.0.200.0030.00516.80
8.0.190.0040.00416.95
8.0.180.0070.00016.81
8.0.170.0000.00916.77
8.0.160.0040.00316.86
8.0.150.0030.00616.78
8.0.140.0000.00816.82
8.0.130.0050.00013.26
8.0.120.0060.00316.83
8.0.110.0000.00716.81
8.0.100.0040.00416.86
8.0.90.0050.00316.82
8.0.80.0040.01116.86
8.0.70.0050.00216.80
8.0.60.0040.00416.77
8.0.50.0000.00716.93
8.0.30.0090.01217.13
8.0.20.0080.01217.00
8.0.10.0040.00416.98
8.0.00.0090.00916.69
7.4.330.0000.00513.08
7.4.320.0000.00716.64
7.4.300.0070.00016.51
7.4.290.0030.00316.68
7.4.280.0000.00816.46
7.4.270.0030.00316.62
7.4.260.0050.00013.23
7.4.250.0040.00416.45
7.4.240.0040.00416.43
7.4.230.0080.00016.45
7.4.220.0060.01216.62
7.4.210.0060.01316.57
7.4.200.0030.00316.63
7.4.190.0000.00716.73
7.4.160.0090.00916.70
7.4.150.0150.00316.79
7.4.140.0130.00516.58
7.4.130.0050.01216.64
7.4.120.0130.01016.57
7.4.110.0060.01316.74
7.4.100.0130.00316.47
7.4.90.0170.01816.51
7.4.80.0150.00619.39
7.4.70.0130.00316.48
7.4.60.0170.00416.43
7.4.50.0030.00316.67
7.4.40.0060.00916.52
7.4.30.0000.01716.79
7.4.00.0040.00814.91
7.3.330.0060.00013.46
7.3.320.0030.00313.30
7.3.310.0070.00016.52
7.3.300.0050.00216.41
7.3.290.0060.00816.51
7.3.280.0080.01116.47
7.3.270.0140.02116.59
7.3.260.0110.00716.79
7.3.250.0090.00916.37
7.3.240.0180.00016.70
7.3.230.0060.00916.44
7.3.210.0140.00716.63
7.3.200.0090.01216.41
7.3.190.0090.01316.46
7.3.180.0080.00816.41
7.3.170.0060.01616.46
7.3.160.0130.01116.55
7.3.120.0000.01515.02
7.3.10.0030.01016.75
7.3.00.0060.00516.75
7.2.330.0130.00616.93
7.2.320.0130.01016.73
7.2.310.0090.00916.88
7.2.300.0060.01216.55
7.2.290.0090.00816.80
7.2.130.0060.00617.04
7.2.120.0030.01016.98
7.2.110.0080.00316.89
7.2.100.0030.00917.04
7.2.90.0030.00916.71
7.2.80.0040.00816.91
7.2.70.0090.00316.82
7.2.60.0040.00616.88
7.2.50.0060.00316.98
7.2.40.0000.01117.00
7.2.30.0070.00416.89
7.2.20.0070.00417.16
7.2.10.0090.00316.96
7.2.00.0040.00718.08
7.1.250.0070.00315.86
7.1.200.0030.00915.88
7.1.100.0030.01018.23
7.1.70.0040.00417.09
7.1.60.0000.01119.30
7.1.50.0040.01816.63
7.1.00.0030.07322.36
7.0.200.0040.00816.89
7.0.140.0030.07322.16
7.0.120.0030.07322.18
7.0.60.0030.07720.00
7.0.50.0030.08317.93
7.0.40.0070.07720.13
7.0.30.0300.04020.08
7.0.20.0400.03320.30
7.0.10.0170.07720.10
7.0.00.0100.04320.29
5.6.280.0030.07321.15
5.6.210.0100.07720.75
5.6.200.0130.06718.18
5.6.190.0030.05720.41
5.6.180.0230.07720.61
5.6.170.0230.05020.48
5.6.160.0200.07320.59
5.6.150.0170.03318.19
5.6.140.0070.04018.14
5.6.130.0070.04718.16
5.6.120.0100.03721.03
5.6.110.0100.08021.04
5.6.100.0070.09020.98
5.6.90.0070.06321.01
5.6.80.0130.07020.41
5.6.70.4600.04020.50
5.5.350.0230.08020.39
5.5.340.0030.03717.94
5.5.330.0200.06020.21
5.5.320.0070.08020.20
5.5.310.0370.06720.27
5.5.300.0000.04017.95
5.5.290.0000.07017.95
5.5.280.0170.07720.91
5.5.270.0000.04320.88
5.5.260.0070.08720.90
5.5.250.0000.04320.71
5.5.240.0300.07320.31
5.4.450.0070.03719.41
5.4.440.0070.03719.21
5.4.430.0070.08019.59
5.4.420.0100.07019.17
5.4.410.0100.04719.07
5.4.400.0070.06019.25
5.4.390.0070.05019.16
5.4.380.0000.06019.24
5.4.370.0030.05318.85
5.4.360.0070.04718.86
5.4.350.0070.07319.26
5.4.340.0070.07318.98
5.4.320.0070.06318.88
5.4.310.0100.04319.25
5.4.300.0130.03019.07
5.4.290.0130.05719.07
5.4.280.0030.04319.24
5.4.270.0030.04318.87
5.4.260.0130.07018.85
5.4.250.0070.04318.84
5.4.240.0100.03018.91
5.4.230.0000.07319.20
5.4.220.0000.09719.25
5.4.210.0130.06018.86
5.4.200.0130.06318.84
5.4.190.0100.03319.14
5.4.180.0100.07319.14
5.4.170.0070.07719.23
5.4.160.0030.07719.10
5.4.150.0070.06718.86
5.4.140.0030.08016.60
5.4.130.0070.08016.39
5.4.120.0030.08016.44
5.4.110.0100.04316.45
5.4.100.0070.07316.36
5.4.90.0130.04716.48
5.4.80.0030.07316.31
5.4.70.0100.07016.53
5.4.60.0130.06316.36
5.4.50.0100.06716.27
5.4.40.0070.07316.38
5.4.30.0030.04316.36
5.4.20.0100.05016.36
5.4.10.0030.05716.45
5.4.00.0100.07015.99
5.3.290.0070.04314.61
5.3.280.0070.03714.62
5.3.270.0030.08014.66
5.3.260.0130.07314.63
5.3.250.0000.05014.64
5.3.240.0030.05314.70
5.3.230.0100.07314.64
5.3.220.0030.07714.64
5.3.210.0070.03714.60
5.3.200.0100.07714.59
5.3.190.0030.04714.63
5.3.180.0070.07714.61
5.3.170.0030.06314.62
5.3.160.0170.05314.75
5.3.150.0070.03714.58
5.3.140.0130.05714.59
5.3.130.0070.07014.58
5.3.120.0070.05314.58
5.3.110.0130.07014.57
5.3.100.0100.06314.22
5.3.90.0000.05013.97
5.3.80.0000.05014.09
5.3.70.0070.07714.04
5.3.60.0070.07714.02
5.3.50.0070.06714.02
5.3.40.0030.04714.00
5.3.30.0130.07013.95
5.3.20.0130.07013.79
5.3.10.0030.07713.84
5.3.00.0030.04713.68
5.2.170.0030.06711.25
5.2.160.0030.06011.19
5.2.150.0130.05311.13
5.2.140.0030.04011.25
5.2.130.0030.06311.14
5.2.120.0070.06011.03
5.2.110.0030.04711.10
5.2.100.0070.06311.08
5.2.90.0000.03311.13
5.2.80.0070.05311.12
5.2.70.0070.03711.13
5.2.60.0070.03711.07
5.2.50.0100.05711.02
5.2.40.0030.03011.08
5.2.30.0030.05310.99
5.2.20.0070.02710.99
5.2.10.0070.05310.93
5.2.00.0030.06310.90
5.1.60.0030.05010.05
5.1.50.0030.05310.05
5.1.40.0030.0279.92
5.1.30.0030.06010.36
5.1.20.0000.05310.39
5.1.10.0100.05710.17
5.1.00.0030.04010.12
5.0.50.0070.0438.55
5.0.40.0000.0438.44
5.0.30.0030.0508.38
5.0.20.0030.0378.38
5.0.10.0030.0338.38
5.0.00.0130.0478.38
4.4.90.0030.0308.38
4.4.80.0000.0208.38
4.4.70.0000.0178.38
4.4.60.0030.0238.38
4.4.50.0030.0138.38
4.4.40.0030.0508.38
4.4.30.0070.0138.38
4.4.20.0030.0278.38
4.4.10.0100.0138.38
4.4.00.0030.0538.38
4.3.110.0000.0378.38
4.3.100.0000.0378.38
4.3.90.0030.0338.38
4.3.80.0070.0278.38
4.3.70.0030.0238.38
4.3.60.0000.0378.38
4.3.50.0000.0308.38
4.3.40.0000.0438.38
4.3.30.0000.0278.38
4.3.20.0030.0208.38
4.3.10.0030.0338.38
4.3.00.0000.0308.38

preferences:
50.45 ms | 401 KiB | 5 Q