3v4l.org

run code in 300+ PHP versions simultaneously
<?php $iterations = 1_000_000; class Result { } benchmark('Result object', fn() => new Result()); benchmark('Exceptions', fn() => throw new \RuntimeException()); function benchmark(string $label, \Closure $closure) { global $iterations; $sT = microtime(true); for ($i = 0; $i < $iterations; $i ++) { try { $closure(); } catch (\Exception $e) { } } echo $label . ' : ' . (microtime(true) - $sT) . 's' . PHP_EOL; }

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.2.110.0130.32021.69
8.1.70.0030.57017.38

preferences:
35.78 ms | 401 KiB | 5 Q