3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ErrorLog { public 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 = self::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 function throwDeprecated ($suppress = false) { // Call this method from INSIDE a deprecated function, self::throwError("Deprecated!", E_USER_NOTICE, $suppress, 2); } private 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.0140.00718.31
8.3.50.0160.00622.05
8.3.40.0070.01118.84
8.3.30.0060.00919.22
8.3.20.0050.00220.35
8.3.10.0030.00623.54
8.3.00.0040.00422.43
8.2.180.0090.00916.63
8.2.170.0100.01022.96
8.2.160.0140.00022.12
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0090.00926.16
8.2.120.0040.00419.36
8.2.110.0070.00322.29
8.2.100.0060.00617.78
8.2.90.0080.00019.08
8.2.80.0050.00317.97
8.2.70.0050.00317.50
8.2.60.0040.00417.80
8.2.50.0030.00518.07
8.2.40.0080.00418.01
8.2.30.0080.00418.10
8.2.20.0040.00417.65
8.2.10.0040.00417.66
8.2.00.0080.00317.72
8.1.280.0070.00725.92
8.1.270.0060.00323.88
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00323.79
8.1.230.0110.00019.12
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00617.23
8.1.190.0040.00417.43
8.1.180.0040.00418.10
8.1.170.0060.00318.50
8.1.160.0000.00721.99
8.1.150.0050.00218.51
8.1.140.0040.00417.42
8.1.130.0000.00817.91
8.1.120.0030.00617.31
8.1.110.0030.00417.42
8.1.100.0040.00417.27
8.1.90.0070.00017.26
8.1.80.0000.00717.23
8.1.70.0000.00717.35
8.1.60.0000.00917.55
8.1.50.0000.00917.40
8.1.40.0030.00517.50
8.1.30.0030.00517.57
8.1.20.0000.00917.60
8.1.10.0040.00417.45
8.1.00.0060.00317.50
8.0.300.0040.00418.77
8.0.290.0000.00717.30
8.0.280.0000.00718.42
8.0.270.0030.00317.19
8.0.260.0070.00016.86
8.0.250.0070.00016.89
8.0.240.0040.00417.02
8.0.230.0000.00717.02
8.0.220.0000.00716.90
8.0.210.0070.00016.91
8.0.200.0000.00616.91
8.0.190.0040.00417.03
8.0.180.0070.00416.95
8.0.170.0060.00316.98
8.0.160.0050.00316.89
8.0.150.0070.00016.84
8.0.140.0080.00016.95
8.0.130.0040.00413.39
8.0.120.0040.00416.86
8.0.110.0000.00817.00
8.0.100.0040.00416.95
8.0.90.0000.00716.82
8.0.80.0090.00616.81
8.0.70.0040.00417.00
8.0.60.0000.00716.84
8.0.50.0000.00716.97
8.0.30.0150.00717.02
8.0.20.0120.01217.40
8.0.10.0040.00417.00
8.0.00.0110.01016.75
7.4.330.0050.00015.09
7.4.320.0060.00016.68
7.4.300.0000.00716.52
7.4.290.0070.00016.64
7.4.280.0070.00016.39
7.4.270.0030.00616.65
7.4.260.0040.00416.58
7.4.250.0070.00016.50
7.4.240.0020.00616.53
7.4.230.0030.00316.75
7.4.220.0200.00816.64
7.4.210.0080.00916.57
7.4.200.0030.00316.49
7.4.190.0000.00816.42
7.4.160.0120.00316.82
7.4.150.0110.00717.40
7.4.140.0120.00517.86
7.4.130.0120.00916.56
7.4.120.0060.01216.66
7.4.110.0090.00916.55
7.4.100.0060.01216.57
7.4.90.0070.01016.58
7.4.80.0110.01116.73
7.4.70.0120.00416.81
7.4.60.0070.01016.48
7.4.50.0030.00516.60
7.4.40.0110.00422.77
7.4.30.0130.00316.54
7.4.00.0070.00714.86
7.3.330.0030.00313.44
7.3.320.0030.00313.45
7.3.310.0000.00816.47
7.3.300.0000.00716.46
7.3.290.0130.00716.44
7.3.280.0080.01216.44
7.3.270.0090.00917.40
7.3.260.0290.02016.49
7.3.250.0150.00416.42
7.3.240.0080.00816.63
7.3.230.0130.00416.55
7.3.210.0030.01816.60
7.3.200.0030.01319.39
7.3.190.0040.01316.48
7.3.180.0050.01116.36
7.3.170.0170.00016.57
7.3.160.0080.00816.38
7.3.120.0090.00614.95
7.3.10.0120.00816.31
7.3.00.0120.00916.46
7.2.330.0030.01516.56
7.2.320.0090.01116.37
7.2.310.0000.01716.58
7.2.300.0100.00716.56
7.2.290.0140.00416.59
7.2.130.0070.01516.65
7.2.120.0120.00816.78
7.2.110.0170.00716.48
7.2.100.0170.00316.73
7.2.90.0100.01316.71
7.2.80.0070.00716.66
7.2.70.0090.00516.55
7.2.60.0110.00516.82
7.2.50.0070.00716.76
7.2.40.0120.00316.68
7.2.30.0100.00716.66
7.2.20.0030.00916.75
7.2.10.0060.00616.64
7.2.00.0070.00417.04
7.1.250.0210.00615.39
7.1.200.0080.00815.86
7.1.100.0090.00617.99
7.1.70.0090.00317.15
7.1.60.0160.00919.24
7.1.50.0080.01516.91
7.1.00.0070.07322.30
7.0.200.0060.00916.84
7.0.140.0000.07322.16
7.0.100.0130.07719.98
7.0.90.0130.07019.98
7.0.80.0170.07719.95
7.0.70.0100.07720.00
7.0.60.0130.07720.12
7.0.50.0070.08720.40
7.0.40.0130.07720.11
7.0.30.0070.04020.13
7.0.20.0130.06720.18
7.0.10.0000.07720.10
7.0.00.0230.06320.10
5.6.280.0000.07320.84
5.6.250.0230.06720.55
5.6.240.0100.05020.51
5.6.230.0170.07320.69
5.6.220.0070.08320.51
5.6.210.0030.09020.63
5.6.200.0070.04321.08
5.6.190.0130.07320.96
5.6.180.0130.06321.10
5.6.170.0100.06721.13
5.6.160.0070.05021.19
5.6.150.0030.09320.95
5.6.140.0070.06720.93
5.6.130.0030.04721.05
5.6.120.0200.06720.95
5.6.110.0130.08021.05
5.6.100.0100.07021.04
5.6.90.0100.07020.94
5.6.80.0130.06720.57
5.6.70.0170.07320.34
5.6.60.0030.04320.34
5.6.50.0100.07720.43
5.6.40.0070.04720.39
5.6.30.0130.05720.39
5.6.20.0070.04020.34
5.6.10.0100.04320.41
5.6.00.0000.04320.43
5.5.380.0000.05020.52
5.5.370.0070.06020.56
5.5.360.0200.07020.51
5.5.350.0030.08720.45
5.5.340.0070.05320.64
5.5.330.0000.07720.89
5.5.320.0100.08020.91
5.5.310.0070.07720.93
5.5.300.0030.05720.82
5.5.290.0100.08020.85
5.5.280.0100.08320.94
5.5.270.0070.08320.74
5.5.260.0070.05320.87
5.5.250.0200.06720.61
5.5.240.0130.08020.30
5.5.230.0030.07720.32
5.5.220.0100.07320.04
5.5.210.0030.09020.32
5.5.200.0070.04020.15
5.5.190.0030.04320.26
5.5.180.0000.04320.27
5.5.160.0070.03720.27
5.5.150.0030.04320.09
5.5.140.0070.03720.26
5.5.130.0030.04020.20
5.5.120.0100.03320.13
5.5.110.0070.03720.13
5.5.100.0030.04320.18
5.5.90.0030.04720.09
5.5.80.0070.04019.99
5.5.70.0030.04720.15
5.5.60.0070.04020.13
5.5.50.0030.04020.11
5.5.40.0130.06720.08
5.5.30.0130.04720.16
5.5.20.0100.05320.07
5.5.10.0070.03720.12
5.5.00.0030.05320.02
5.4.450.0200.06719.38
5.4.440.0000.08719.41
5.4.430.0070.05319.27
5.4.420.0100.07719.34
5.4.410.0070.04319.43
5.4.400.0030.08319.05
5.4.390.0070.08019.09
5.4.380.0130.06019.09
5.4.370.0100.07019.03
5.4.360.0130.07319.16
5.4.350.0000.04319.13
5.4.340.0170.03019.02
5.4.320.0070.04019.05
5.4.310.0070.05318.85
5.4.300.0030.04019.12
5.4.290.0030.04018.85
5.4.280.0070.03718.87
5.4.270.0000.04719.17
5.4.260.0070.06319.02
5.4.250.0000.04319.02
5.4.240.0030.04319.03
5.4.230.0030.05319.00
5.4.220.0070.03719.04
5.4.210.0070.03719.17
5.4.200.0000.04319.04
5.4.190.0070.06718.94
5.4.180.0000.04718.93
5.4.170.0000.04718.89
5.4.160.0070.03719.16
5.4.150.0070.06718.95
5.4.140.0100.03016.50
5.4.130.0070.03316.51
5.4.120.0000.04316.50
5.4.110.0030.04016.53
5.4.100.0030.05016.49
5.4.90.0030.03716.49
5.4.80.0000.04716.37
5.4.70.0070.03316.38
5.4.60.0030.04016.37
5.4.50.0030.03716.31
5.4.40.0100.03016.30
5.4.30.0030.03016.45
5.4.20.0000.04716.30
5.4.10.0100.05716.46
5.4.00.0000.04315.95
5.3.290.0070.03714.77
5.3.280.0000.04314.59
5.3.270.0130.03014.61
5.3.260.0030.03714.66
5.3.250.0000.04714.58
5.3.240.0130.04314.62
5.3.230.0100.04714.67
5.3.220.0030.04314.60
5.3.210.0000.04014.64
5.3.200.0000.04014.71
5.3.190.0070.03714.70
5.3.180.0030.04014.51
5.3.170.0070.03314.52
5.3.160.0070.03714.73
5.3.150.0030.03314.64
5.3.140.0030.03714.70
5.3.130.0030.03714.49
5.3.120.0070.04314.50
5.3.110.0030.03714.58
5.3.100.0070.03314.20
5.3.90.0030.04014.02
5.3.80.0030.04014.17
5.3.70.0000.04014.11
5.3.60.0030.03714.04
5.3.50.0070.03013.88
5.3.40.0000.03313.86
5.3.30.0000.04313.86
5.3.20.0000.04013.78
5.3.10.0100.06713.59
5.3.00.0100.03013.73
5.2.170.0030.06011.29
5.2.160.0070.06311.29
5.2.150.0070.03311.05
5.2.140.0100.03711.20
5.2.130.0030.04711.04
5.2.120.0000.03010.99
5.2.110.0000.03311.14
5.2.100.0030.03011.04
5.2.90.0000.03011.01
5.2.80.0000.03711.04
5.2.70.0070.03711.21
5.2.60.0030.05311.20
5.2.50.0070.02711.07
5.2.40.0070.04710.93
5.2.30.0070.03311.11
5.2.20.0070.05310.84
5.2.10.0030.03711.00
5.2.00.0030.03010.65
5.1.60.0100.04010.11
5.1.50.0070.03710.11
5.1.40.0030.04010.11
5.1.30.0000.03310.39
5.1.20.0030.05010.30
5.1.10.0030.02710.19
5.1.00.0000.03010.09
5.0.50.0030.0438.98
5.0.40.0030.0208.98
5.0.30.0030.0308.98
5.0.20.0030.0178.98
5.0.10.0000.0208.98
5.0.00.0000.0308.98
4.4.90.0000.0208.98
4.4.80.0030.0138.98
4.4.70.0000.0178.98
4.4.60.0000.0178.98
4.4.50.0000.0238.98
4.4.40.0030.0278.98
4.4.30.0000.0208.98
4.4.20.0000.0278.98
4.4.10.0030.0178.98
4.4.00.0000.0408.98
4.3.110.0030.0238.98
4.3.100.0030.0138.98
4.3.90.0030.0138.98
4.3.80.0000.0278.98
4.3.70.0000.0178.98
4.3.60.0070.0108.98
4.3.50.0000.0178.98
4.3.40.0000.0238.98
4.3.30.0000.0178.98
4.3.20.0030.0178.98
4.3.10.0000.0178.98
4.3.00.0000.0178.98

preferences:
51.14 ms | 401 KiB | 5 Q