3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * php error handler / suppressed deprecation notices * @link https://stackoverflow.com/a/74791189/367456 */ // don't have E_DEPRECATED in reporting on @3v4l.org error_reporting(error_reporting() ^ E_DEPRECATED); // no interest in arguments ini_set('zend.exception_ignore_args', '1'); /* track */ new Deprecations; $mixed = null; $string = @trim($mixed); $html = @htmlspecialchars($mixed, ENT_QUOTES | ENT_HTML5); $forgotten = trim($mixed); class Deprecations { public function __construct($handler = true, $reporter = true) { $reporter && register_shutdown_function(static function () use (&$deprecations) { // stream collected deprecations as JavaScript Object Notation (JSON) Text Sequences on the SAPI diagnostic channel // shutdown handling could condense repeated reports etc. as could the error handler. example material, there must // be no shutdown function at all. foreach ((array)$deprecations as $deprecation) { $error = $deprecation['error']; unset($deprecation['error']); is_object($error) && get_class($error) === ErrorException::class && $error = eval('return ' . substr(ltrim(var_export($error, true), '\\'), 27) . ';'); error_log("\x1E" . json_encode( ['E_DEPRECATED', [...array_values($deprecation), $error['trace'] ?? null]], JSON_UNESCAPED_SLASHES )); } error_log("\x1E"); }); $handler && set_error_handler(static function ($type, $message, $file, $line) use (&$deprecations) { // capture the currently active error reporting level to decide whether // reporting is active (throws) or not (standard PHP error handler) $reporting = error_reporting(); // capture backtraces, your mileage may vary: with many of them, // you may not be interested in the beginning (resource constraints!). $error = new ErrorException($message, $type, $reporting, $file, $line); // capture E_DEPRECATED if ($type === E_DEPRECATED) { $deprecations[] = ['deprecations' => count($deprecations ?: [])] + get_defined_vars(); } if (!($reporting & $type)) { // This error code is not included in error_reporting, so let it fall // through to the standard PHP error handler return false; } // throwing error handler, your mileage may vary, controlled by // error_reporting() / error_reporting (ini) throw $error; }, E_DEPRECATED); } }

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.130.0090.00018.74
8.3.120.0170.00319.07
8.3.110.0040.00418.56
8.3.100.0100.00016.87
8.3.90.0060.00326.77
8.3.80.0080.00418.55
8.3.70.0090.00618.68
8.3.60.0110.00716.75
8.3.50.0090.00618.41
8.3.40.0110.00420.20
8.3.30.0120.00318.88
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0050.00326.16
8.2.250.0030.00716.83
8.2.240.0040.00417.48
8.2.230.0080.00820.94
8.2.220.0030.00624.06
8.2.210.0110.00726.77
8.2.200.0000.01218.41
8.2.190.0120.00618.54
8.2.180.0150.00025.92
8.2.170.0120.01219.03
8.2.160.0120.00622.96
8.2.150.0040.01125.66
8.2.140.0030.00524.66
8.2.130.0050.00326.16
8.2.120.0000.00819.76
8.2.110.0030.00721.04
8.2.100.0000.01118.03
8.2.90.0000.00817.97
8.2.80.0060.00319.95
8.2.70.0080.00748.48
8.2.60.0080.00733.06
8.2.50.0120.00248.70
8.2.40.0090.00450.22
8.2.30.0050.00948.70
8.2.20.0100.00349.34
8.2.10.0090.00448.74
8.2.00.0090.00748.57
8.1.300.0080.00820.00
8.1.290.0090.00030.84
8.1.280.0160.00716.32
8.1.270.0030.01624.66
8.1.260.0100.01026.35
8.1.250.0000.00828.09
8.1.240.0000.00920.73
8.1.230.0080.00322.13
8.1.220.0030.00617.78
8.1.210.0030.00618.77
8.1.200.0080.00548.34
8.1.190.0120.00048.34
8.1.180.0040.00848.71
8.1.170.0070.00648.96
8.1.160.0080.00449.08
8.1.150.0030.01149.01
8.1.140.0060.00648.37
8.1.130.0130.00348.35
8.1.120.0100.00748.39
8.1.110.0110.00548.42
8.1.100.0130.00448.38
8.1.90.0080.00948.39
8.1.80.0110.00648.39
8.1.70.0110.00648.46
8.1.60.0130.00748.48
8.1.50.0170.00348.44
8.1.40.0120.00648.49
8.1.30.0160.00348.42
8.1.20.0150.00448.48
8.1.10.0130.00648.46
8.1.00.0090.00948.46
8.0.300.0070.00019.99
8.0.290.0090.00348.04
8.0.280.0080.00448.89
8.0.270.0060.00648.24
8.0.260.0120.00448.10
8.0.250.0100.00748.16
8.0.240.0080.00748.14
8.0.230.0150.00448.12
8.0.220.0100.00648.10
8.0.210.0100.00448.14
8.0.200.0050.01148.10
8.0.190.0080.00548.10
8.0.180.0130.00148.14
8.0.170.0130.00248.12
8.0.160.0100.00748.16
8.0.150.0130.00548.13
8.0.140.0140.00248.10
8.0.130.0100.00648.14
8.0.120.0110.00448.10
8.0.110.0090.00748.10
8.0.100.0120.00448.10
8.0.90.0100.00548.10
8.0.80.0080.00648.13
8.0.70.0100.00548.10
8.0.60.0160.00048.10
8.0.50.0130.00248.10
8.0.30.0170.00048.11
8.0.20.0110.00648.12
8.0.10.0120.00248.17

preferences:
24.57 ms | 403 KiB | 5 Q