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 = 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); } } function throwDeprecated ($suppress = false) { // Call this method from INSIDE a deprecated function, self::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.0040.01116.50
8.3.50.0090.01316.65
8.3.40.0070.00718.76
8.3.30.0060.00918.85
8.3.20.0040.00418.79
8.3.10.0070.00318.69
8.3.00.0040.00419.51
8.2.180.0040.01416.63
8.2.170.0100.00622.96
8.2.160.0090.00621.06
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0120.00620.42
8.2.110.0100.00021.04
8.2.100.0090.00317.78
8.2.90.0030.00719.34
8.2.80.0040.00419.46
8.2.70.0030.00517.63
8.2.60.0000.00817.80
8.2.50.0000.01118.07
8.2.40.0000.00818.22
8.2.30.0070.00017.89
8.2.20.0040.00417.68
8.2.10.0040.00417.83
8.2.00.0040.00417.70
8.1.280.0140.00325.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0060.00322.42
8.1.230.0040.00820.82
8.1.220.0000.00817.74
8.1.210.0030.00518.89
8.1.200.0060.00317.10
8.1.190.0060.00317.53
8.1.180.0080.00018.10
8.1.170.0030.00518.80
8.1.160.0050.00218.80
8.1.150.0030.00718.57
8.1.140.0000.00717.30
8.1.130.0030.00317.77
8.1.120.0000.00717.28
8.1.110.0050.00317.42
8.1.100.0040.00417.42
8.1.90.0070.00017.41
8.1.80.0030.00317.27
8.1.70.0000.00717.27
8.1.60.0070.00017.46
8.1.50.0000.00917.34
8.1.40.0030.00617.38
8.1.30.0040.00417.51
8.1.20.0000.00817.59
8.1.10.0000.00817.45
8.1.00.0050.00317.55
8.0.300.0060.00319.98
8.0.290.0040.00416.75
8.0.280.0000.00718.29
8.0.270.0030.00317.28
8.0.260.0060.00016.77
8.0.250.0050.00317.03
8.0.240.0040.00417.02
8.0.230.0070.00017.02
8.0.220.0030.00316.98
8.0.210.0030.00316.95
8.0.200.0030.00316.96
8.0.190.0040.00416.91
8.0.180.0000.00816.98
8.0.170.0030.00616.79
8.0.160.0070.00016.92
8.0.150.0030.00616.86
8.0.140.0080.00416.77
8.0.130.0000.00613.33
8.0.120.0000.00816.94
8.0.110.0080.00016.98
8.0.100.0070.00016.79
8.0.90.0040.00417.05
8.0.80.0120.00316.88
8.0.70.0040.00416.76
8.0.60.0100.00016.72
8.0.50.0040.00416.73
8.0.30.0080.01117.24
8.0.20.0150.00717.22
8.0.10.0050.00317.02
8.0.00.0120.01016.85
7.4.330.0050.00013.09
7.4.320.0000.00716.54
7.4.300.0040.00416.63
7.4.290.0000.00716.61
7.4.280.0000.00716.66
7.4.270.0030.00616.60
7.4.260.0040.00413.28
7.4.250.0000.00816.54
7.4.240.0040.00416.53
7.4.230.0030.00316.44
7.4.220.0080.01116.67
7.4.210.0080.00916.56
7.4.200.0040.00416.54
7.4.190.0070.00016.73
7.4.160.0070.01016.59
7.4.150.0170.00316.57
7.4.140.0110.01016.42
7.4.130.0130.00716.57
7.4.120.0120.00616.59
7.4.110.0090.00916.44
7.4.100.0090.01316.70
7.4.90.0120.00616.70
7.4.80.0030.01519.39
7.4.70.0110.00616.59
7.4.60.0060.01016.61
7.4.50.0070.00716.28
7.4.40.0130.00316.68
7.4.30.0030.01416.86
7.4.00.0050.01114.72
7.3.330.0030.00313.47
7.3.320.0000.00513.45
7.3.310.0030.00316.31
7.3.300.0070.00016.50
7.3.290.0070.00716.43
7.3.280.0100.00416.45
7.3.270.0150.00316.49
7.3.260.0050.01116.70
7.3.250.0090.01016.57
7.3.240.0030.01316.57
7.3.230.0070.01016.52
7.3.210.0040.01216.46
7.3.200.0090.00916.61
7.3.190.0190.00316.68
7.3.180.0030.01616.41
7.3.170.0090.00916.42
7.3.160.0080.00816.51
7.3.120.0100.00514.92
7.3.110.0030.01414.80
7.3.100.0000.01314.78
7.3.90.0050.00814.92
7.3.80.0000.01414.86
7.3.70.0060.00914.75
7.3.60.0090.00014.91
7.3.50.0030.00914.99
7.3.40.0040.00814.79
7.3.30.0080.00614.91
7.3.20.0030.01016.78
7.3.10.0000.01016.79
7.3.00.0060.00816.64
7.2.330.0090.00816.59
7.2.320.0110.00616.80
7.2.310.0130.00616.57
7.2.300.0070.01116.58
7.2.290.0110.00516.53
7.2.250.0070.01415.12
7.2.240.0060.01015.29
7.2.230.0000.01315.26
7.2.220.0070.01015.06
7.2.210.0110.00415.17
7.2.200.0040.00415.19
7.2.190.0110.00415.18
7.2.180.0040.01115.16
7.2.170.0060.00615.06
7.2.160.0100.00615.14
7.2.150.0000.01417.11
7.2.140.0040.00416.75
7.2.130.0070.00616.82
7.2.120.0060.01016.69
7.2.110.0030.01017.03
7.2.100.0070.00716.93
7.2.90.0030.01016.92
7.2.80.0040.00716.98
7.2.70.0050.00516.81
7.2.60.0030.00917.07
7.2.50.0030.00917.00
7.2.40.0070.00616.70
7.2.30.0070.01117.09
7.2.20.0080.00516.92
7.2.10.0120.00317.07
7.2.00.0100.00316.79
7.1.330.0040.01516.00
7.1.320.0090.00615.84
7.1.310.0030.00615.95
7.1.300.0000.01115.80
7.1.290.0060.00315.79
7.1.280.0000.01015.96
7.1.270.0040.00715.81
7.1.260.0070.00415.46
7.1.250.0070.00716.01
7.1.240.0000.01315.82
7.1.230.0120.00015.46
7.1.220.0000.00815.64
7.1.210.0030.01015.94
7.1.200.0090.00115.57
7.1.190.0090.00015.99
7.1.180.0040.01115.61
7.1.170.0100.00015.94
7.1.160.0000.00815.95
7.1.150.0000.01115.96
7.1.140.0040.00415.54
7.1.130.0060.00615.61
7.1.120.0040.00715.61
7.1.110.0050.00515.86
7.1.100.0040.00815.93
7.1.90.0090.00615.96
7.1.80.0070.00715.66
7.1.70.0050.00416.59
7.1.60.0020.01617.61
7.1.50.0050.01416.46
7.1.40.0000.01315.65
7.1.30.0130.00015.99
7.1.20.0090.00015.46
7.1.10.0030.00615.85
7.1.00.0030.04019.21
7.0.330.0080.00415.45
7.0.320.0030.00615.29
7.0.310.0070.00315.58
7.0.300.0030.00615.27
7.0.290.0040.00415.27
7.0.280.0040.00815.27
7.0.270.0030.00915.25
7.0.260.0030.01015.40
7.0.250.0070.00315.27
7.0.240.0070.00715.60
7.0.230.0000.00815.60
7.0.220.0030.00715.25
7.0.210.0060.00315.28
7.0.200.0060.00616.10
7.0.190.0060.00815.43
7.0.180.0030.00915.34
7.0.170.0040.00815.54
7.0.160.0100.00315.48
7.0.150.0080.00515.52
7.0.140.0050.03918.83
7.0.130.0130.00015.54
7.0.120.0050.02218.72
7.0.110.0030.01015.42
7.0.100.0100.00315.32
7.0.90.0090.00615.55
7.0.80.0030.00615.71
7.0.70.0090.00315.32
7.0.60.0050.03617.58
7.0.50.0030.03216.80
7.0.40.0070.02716.79
7.0.30.0130.03116.84
7.0.20.0210.03816.96
7.0.10.0230.03416.87
7.0.00.0080.03716.86
5.6.400.0000.01014.65
5.6.390.0120.00314.69
5.6.380.0040.01114.83
5.6.370.0000.01714.56
5.6.360.0070.00714.24
5.6.350.0000.01414.13
5.6.340.0040.01114.37
5.6.330.0040.00814.46
5.6.320.0000.00814.42
5.6.310.0060.01014.14
5.6.300.0070.01014.43
5.6.290.0030.01214.68
5.6.280.0120.00614.62
5.6.270.0070.00314.54
5.6.260.0030.00714.74
5.6.250.0090.00614.62
5.6.240.0070.00714.45
5.6.230.0030.00714.81
5.6.220.0110.00314.35
5.6.210.0100.04017.51
5.6.200.0050.04316.31
5.6.190.0050.04517.38
5.6.180.0190.02717.46
5.6.170.0200.03817.52
5.6.160.0030.04817.41
5.6.150.0050.03116.20
5.6.140.0020.03216.30
5.6.130.0090.04216.32
5.6.120.0120.03317.71
5.6.110.0040.02817.55
5.6.100.0050.04717.69
5.6.90.0120.03217.61
5.6.80.0110.04017.53
5.6.70.0130.04717.40
5.6.60.0080.00514.36
5.6.50.0070.00314.59
5.6.40.0070.00714.68
5.6.30.0000.01414.42
5.6.20.0060.00914.30
5.6.10.0080.00014.39
5.6.00.0060.00614.31
5.5.380.0120.00014.52
5.5.370.0080.00314.64
5.5.360.0130.00014.27
5.5.350.0100.02617.50
5.5.340.0050.02315.97
5.5.330.0070.02817.25
5.5.320.0120.02617.37
5.5.310.0170.03917.37
5.5.300.0080.04016.00
5.5.290.0020.02516.18
5.5.280.0060.02717.63
5.5.270.0010.05017.73
5.5.260.0050.03317.66
5.5.250.0070.04317.37
5.5.240.0050.02517.30
5.5.230.0070.00314.35
5.5.220.0000.01414.28
5.5.210.0040.01014.43
5.5.200.0070.00314.23
5.5.190.0060.00314.00
5.5.180.0080.00414.29
5.5.170.0070.00414.27
5.5.160.0080.00814.47
5.5.150.0060.00314.40
5.5.140.0030.00914.39
5.5.130.0070.00714.68
5.5.120.0100.00313.92
5.5.110.0070.01014.33
5.5.100.0030.00714.43
5.5.90.0030.00614.39
5.5.80.0000.01214.35
5.5.70.0030.01214.18
5.5.60.0030.01114.46
5.5.50.0100.00314.12
5.5.40.0040.01114.24
5.5.30.0000.00814.62
5.5.20.0060.00614.57
5.5.10.0030.00614.04
5.5.00.0060.00914.43
5.4.450.0060.02315.29
5.4.440.0050.02315.25
5.4.430.0090.04015.22
5.4.420.0070.03515.29
5.4.410.0030.04815.30
5.4.400.0030.04115.07
5.4.390.0030.02515.21
5.4.380.0060.01815.09
5.4.370.0060.02715.12
5.4.360.0000.02715.07
5.4.350.0020.03215.35
5.4.340.0080.03815.11
5.4.330.0000.00910.98
5.4.320.0020.03015.01
5.4.310.0080.02115.00
5.4.300.0030.03215.04
5.4.290.0000.02915.26
5.4.280.0050.03015.12
5.4.270.0050.03015.20
5.4.260.0080.04315.02
5.4.250.0050.03215.13
5.4.240.0050.04015.13
5.4.230.0030.03415.01
5.4.220.0010.04315.09
5.4.210.0040.04214.99
5.4.200.0050.03915.27
5.4.190.0110.02215.11
5.4.180.0050.04014.97
5.4.170.0020.03615.27
5.4.160.0030.02515.18
5.4.150.0050.02915.13
5.4.140.0020.02313.85
5.4.130.0050.02813.75
5.4.120.0080.03813.67
5.4.110.0040.03913.82
5.4.100.0070.04213.99
5.4.90.0030.03613.87
5.4.80.0000.04114.03
5.4.70.0030.04013.74
5.4.60.0070.03614.01
5.4.50.0050.02313.70
5.4.40.0050.04013.68
5.4.30.0050.02213.68
5.4.20.0070.02213.72
5.4.10.0060.03813.92
5.4.00.0050.03313.53
5.3.290.0070.02812.78
5.3.280.0030.02612.75
5.3.270.0030.04012.81
5.3.260.0000.02812.85
5.3.250.0030.02012.75
5.3.240.0020.02212.75
5.3.230.0030.03812.81
5.3.220.0020.02612.82
5.3.210.0090.03812.87
5.3.200.0060.01812.81
5.3.190.0050.02412.74
5.3.180.0050.04212.80
5.3.170.0020.02912.79
5.3.160.0030.02012.79
5.3.150.0020.03212.78
5.3.140.0020.02212.81
5.3.130.0050.01812.78
5.3.120.0030.02212.79
5.3.110.0020.03012.80
5.3.100.0070.02012.53
5.3.90.0020.02512.54
5.3.80.0030.03112.48
5.3.70.0030.03212.52
5.3.60.0090.02512.58
5.3.50.0070.04212.47
5.3.40.0070.02512.50
5.3.30.0050.02812.48
5.3.20.0030.03312.32
5.3.10.0060.03612.33
5.3.00.0050.03012.32
5.2.170.0130.05011.18
5.2.160.0070.04711.26
5.2.150.0030.04311.15
5.2.140.0070.06011.21
5.2.130.0100.05311.32
5.2.120.0070.06011.03
5.2.110.0070.05011.09
5.2.100.0070.06011.13
5.2.90.0100.02311.29
5.2.80.0030.03311.13
5.2.70.0000.03711.05
5.2.60.0000.03311.05
5.2.50.0030.06011.09
5.2.40.0100.03710.97
5.2.30.0030.03310.96
5.2.20.0070.03011.00
5.2.10.0130.05310.80
5.2.00.0170.02310.91
5.1.60.0100.02310.00
5.1.50.0100.05010.08
5.1.40.0030.03310.05
5.1.30.0000.04710.37
5.1.20.0030.05710.34
5.1.10.0070.04710.25
5.1.00.0030.03310.07
5.0.50.0030.0278.64
5.0.40.0000.0208.51
5.0.30.0000.0538.51
5.0.20.0030.0338.51
5.0.10.0100.0378.51
5.0.00.0030.0538.51
4.4.90.0000.0178.51
4.4.80.0000.0208.51
4.4.70.0000.0178.51
4.4.60.0000.0278.51
4.4.50.0000.0178.51
4.4.40.0000.0478.51
4.4.30.0000.0208.51
4.4.20.0030.0238.51
4.4.10.0030.0208.51
4.4.00.0030.0538.51
4.3.110.0000.0338.51
4.3.100.0000.0208.51
4.3.90.0030.0178.51
4.3.80.0070.0278.51
4.3.70.0070.0278.51
4.3.60.0000.0308.51
4.3.50.0030.0208.51
4.3.40.0070.0478.51
4.3.30.0070.0138.51
4.3.20.0000.0238.51
4.3.10.0000.0238.51
4.3.00.0000.0208.51

preferences:
38.53 ms | 401 KiB | 5 Q