3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ErrorLog { 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.60.0140.00716.74
8.3.50.0070.01516.61
8.3.40.0170.00318.83
8.3.30.0100.00718.84
8.3.20.0000.00918.91
8.3.10.0050.00320.57
8.3.00.0060.00319.38
8.2.180.0180.00017.00
8.2.170.0140.00022.96
8.2.160.0110.00320.71
8.2.150.0070.00024.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0090.00517.25
8.2.110.0000.01022.20
8.2.100.0030.00917.78
8.2.90.0050.00317.84
8.2.80.0000.00817.97
8.2.70.0040.00417.50
8.2.60.0040.00417.93
8.2.50.0020.00718.07
8.2.40.0040.00418.09
8.2.30.0100.00018.05
8.2.20.0060.00317.67
8.2.10.0050.00317.77
8.2.00.0080.00017.63
8.1.280.0070.00725.92
8.1.270.0050.00324.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.92
8.1.230.0000.01120.95
8.1.220.0000.00917.74
8.1.210.0030.00618.89
8.1.200.0030.00617.22
8.1.190.0050.00317.40
8.1.180.0050.00318.10
8.1.170.0040.00418.77
8.1.160.0000.00718.79
8.1.150.0040.00418.54
8.1.140.0060.00317.36
8.1.130.0040.00417.66
8.1.120.0000.00817.37
8.1.110.0070.00017.40
8.1.100.0000.00717.25
8.1.90.0000.00717.36
8.1.80.0050.00317.31
8.1.70.0030.00317.31
8.1.60.0030.00517.45
8.1.50.0080.00017.37
8.1.40.0040.00417.51
8.1.30.0090.00017.68
8.1.20.0040.00417.44
8.1.10.0000.00817.60
8.1.00.0080.00017.48
8.0.300.0030.00519.91
8.0.290.0050.00216.75
8.0.280.0000.00718.41
8.0.270.0030.00317.09
8.0.260.0000.00716.89
8.0.250.0030.00617.02
8.0.240.0040.00416.98
8.0.230.0030.00316.98
8.0.220.0030.00316.82
8.0.210.0000.00716.92
8.0.200.0040.00416.94
8.0.190.0040.00417.03
8.0.180.0090.00016.87
8.0.170.0040.00416.89
8.0.160.0040.00416.81
8.0.150.0060.00316.96
8.0.140.0040.00716.77
8.0.130.0060.00013.43
8.0.120.0040.00416.80
8.0.110.0000.00716.95
8.0.100.0000.00716.80
8.0.90.0000.00716.79
8.0.80.0110.00416.95
8.0.70.0040.00416.91
8.0.60.0030.00516.80
8.0.50.0000.00716.80
8.0.30.0110.00817.07
8.0.20.0130.00517.04
8.0.10.0080.00017.00
8.0.00.0130.00816.67
7.4.330.0000.00513.09
7.4.320.0030.00316.64
7.4.300.0000.00616.61
7.4.290.0070.00016.66
7.4.280.0080.00016.38
7.4.270.0030.00316.54
7.4.260.0000.00613.33
7.4.250.0030.00616.43
7.4.240.0030.00316.67
7.4.230.0030.00316.52
7.4.220.0070.01416.46
7.4.210.0070.00916.59
7.4.200.0070.00016.51
7.4.190.0030.00316.57
7.4.160.0100.00716.49
7.4.150.0120.00616.52
7.4.140.0100.01016.63
7.4.130.0130.00716.56
7.4.120.0080.00816.54
7.4.110.0080.00916.55
7.4.100.0140.00416.61
7.4.90.0040.01316.51
7.4.80.0160.00619.39
7.4.70.0110.00616.63
7.4.60.0170.00616.57
7.4.50.0000.00816.71
7.4.40.0090.00616.56
7.4.30.0110.00616.56
7.4.00.0040.01115.10
7.3.330.0000.00613.43
7.3.320.0040.00413.25
7.3.310.0050.00216.48
7.3.300.0000.00716.44
7.3.290.0150.00416.52
7.3.280.0090.00916.42
7.3.270.0120.00616.63
7.3.260.0060.01016.45
7.3.250.0130.00716.60
7.3.240.0100.00716.42
7.3.230.0150.00616.45
7.3.210.0090.00916.71
7.3.200.0030.01316.35
7.3.190.0130.01016.66
7.3.180.0120.00616.53
7.3.170.0130.00316.54
7.3.160.0000.01516.55
7.3.120.0000.01714.76
7.3.10.0070.00716.71
7.3.00.0100.00716.74
7.2.330.0110.00716.75
7.2.320.0090.01216.63
7.2.310.0100.01316.92
7.2.300.0110.00516.70
7.2.290.0130.00616.55
7.2.130.0120.00316.81
7.2.120.0040.00816.91
7.2.110.0070.00717.10
7.2.100.0060.00616.97
7.2.90.0130.00316.78
7.2.80.0000.00916.97
7.2.70.0030.01017.02
7.2.60.0090.01016.89
7.2.50.0000.01416.77
7.2.40.0090.00616.75
7.2.30.0040.01117.04
7.2.20.0030.00616.93
7.2.10.0050.00516.93
7.2.00.0000.01218.29
7.1.250.0030.01015.95
7.1.200.0040.01216.00
7.1.70.0060.00317.28
7.1.60.0030.00717.03
7.1.50.0100.01016.95
7.1.00.0030.07322.33
7.0.200.0080.00816.54
7.0.140.0000.07722.08
7.0.120.0000.07722.19
7.0.60.0000.08719.91
7.0.50.0170.06717.88
7.0.40.0070.05020.21
7.0.30.0370.07320.19
7.0.20.0200.04020.30
7.0.10.0170.05020.20
7.0.00.0070.08720.12
5.6.280.0000.07721.01
5.6.210.0070.07720.62
5.6.200.0230.06718.20
5.6.190.0030.06720.41
5.6.180.0200.05720.79
5.6.170.0330.07720.45
5.6.160.0130.08020.54
5.6.150.0000.08318.29
5.6.140.0070.07718.29
5.6.130.0030.04018.13
5.6.120.0030.04321.03
5.6.110.0130.07720.97
5.6.100.0100.07721.13
5.6.90.0130.05020.98
5.6.80.0070.08020.37
5.6.70.4470.03720.41
5.5.350.0530.05020.48
5.5.340.0070.03717.93
5.5.330.0070.08720.57
5.5.320.0100.04020.29
5.5.310.0400.06720.24
5.5.300.0070.07717.98
5.5.290.0030.08318.08
5.5.280.0070.04320.79
5.5.270.0000.04720.90
5.5.260.0030.08020.78
5.5.250.0070.03720.63
5.5.240.0130.03720.27
5.4.450.0030.05319.54
5.4.440.0100.07319.41
5.4.430.0100.07019.17
5.4.420.0070.06319.47
5.4.410.0170.07019.44
5.4.400.0070.08018.98
5.4.390.0070.08018.86
5.4.380.0030.08019.25
5.4.370.0030.05319.24
5.4.360.0070.07718.96
5.4.350.0100.07718.84
5.4.340.0030.05019.25
5.4.320.0030.06718.85
5.4.310.0030.08319.01
5.4.300.0100.07718.84
5.4.290.0130.07018.92
5.4.280.0070.08318.85
5.4.270.0000.04018.92
5.4.260.0070.03719.13
5.4.250.0000.04018.91
5.4.240.0000.05019.20
5.4.230.0070.03318.84
5.4.220.0030.03719.23
5.4.210.0100.03018.84
5.4.200.0030.03718.84
5.4.190.0000.04319.22
5.4.180.0070.03319.14
5.4.170.0070.04319.23
5.4.160.0000.04019.13
5.4.150.0030.03719.00
5.4.140.0130.03316.52
5.4.130.0000.03716.43
5.4.120.0030.03316.45
5.4.110.0030.03316.46
5.4.100.0030.03716.44
5.4.90.0030.03316.39
5.4.80.0030.03316.46
5.4.70.0000.03716.34
5.4.60.0070.03316.38
5.4.50.0030.03716.27
5.4.40.0070.04316.45
5.4.30.0030.03316.30
5.4.20.0030.03316.38
5.4.10.0130.03316.45
5.4.00.0100.03015.99
5.3.290.0170.06714.74
5.3.280.0030.04314.65
5.3.270.0100.03014.63
5.3.260.0030.03714.77
5.3.250.0030.03714.68
5.3.240.0000.03714.77
5.3.230.0000.04014.50
5.3.220.0030.03714.61
5.3.210.0100.04014.59
5.3.200.0030.03314.59
5.3.190.0070.03314.47
5.3.180.0030.03714.50
5.3.170.0000.03714.56
5.3.160.0000.04014.74
5.3.150.0000.03714.47
5.3.140.0030.03714.57
5.3.130.0000.04314.56
5.3.120.0000.04714.48
5.3.110.0030.03714.57
5.3.100.0200.03014.06
5.3.90.0030.03714.09
5.3.80.0030.03714.07
5.3.70.0030.03314.07
5.3.60.0030.04014.08
5.3.50.0070.03314.12
5.3.40.0000.05013.92
5.3.30.0030.03713.96
5.3.20.0000.04313.76
5.3.10.0130.06313.71
5.3.00.0100.05013.71
5.2.170.0000.03011.33
5.2.160.0070.04711.23
5.2.150.0100.02311.21
5.2.140.0030.02711.23
5.2.130.0000.03311.19
5.2.120.0100.04011.17
5.2.110.0000.06311.05
5.2.100.0030.05711.09
5.2.90.0100.04311.14
5.2.80.0030.03011.16
5.2.70.0000.03311.28
5.2.60.0000.03311.14
5.2.50.0030.05310.96
5.2.40.0070.03011.02
5.2.30.0030.06010.88
5.2.20.0100.05711.04
5.2.10.0070.05710.77
5.2.00.0030.04710.75
5.1.60.0130.04710.16
5.1.50.0000.06010.05
5.1.40.0070.02710.16
5.1.30.0000.04010.43
5.1.20.0130.02710.45
5.1.10.0000.06010.10
5.1.00.0070.03310.09
5.0.50.0070.0278.63
5.0.40.0000.0338.46
5.0.30.0000.0708.32
5.0.20.0030.0408.16
5.0.10.0030.0438.27
5.0.00.0000.0708.19
4.4.90.0000.0338.13
4.4.80.0000.0178.13
4.4.70.0030.0338.13
4.4.60.0030.0308.13
4.4.50.0000.0408.13
4.4.40.0000.0608.13
4.4.30.0030.0238.13
4.4.20.0030.0208.13
4.4.10.0000.0338.13
4.4.00.0030.0338.13
4.3.110.0000.0378.13
4.3.100.0030.0338.13
4.3.90.0030.0378.13
4.3.80.0070.0378.13
4.3.70.0000.0238.13
4.3.60.0030.0178.13
4.3.50.0030.0138.13
4.3.40.0030.0508.13
4.3.30.0000.0408.13
4.3.20.0000.0308.13
4.3.10.0000.0338.13
4.3.00.0000.0278.13

preferences:
45.8 ms | 400 KiB | 5 Q