3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function isOk() { return $this->log(true, __FUNCTION__); } public function isFalse() { return $this->log(false); } private function log(mixed $result, string $methodName = null) { if (!isset($methodName)) { $methodName = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]["function"]; } //echo $methodName, "\n"; } } $c = new Test; for($t=hrtime(true),$i=0;$i<1e6;++$i) $c->isOk(); printf("magic const: %.3fms\n", (hrtime(true)-$t)/1000_000); for($t=hrtime(true),$i=0;$i<1e6;++$i) $c->isFalse(); printf("debug trace: %.3fms\n", (hrtime(true)-$t)/1000_000);

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.70.0100.38916.58
8.3.60.0100.31818.38
8.3.50.0070.32120.11
8.3.40.0100.32420.20
8.3.30.0130.31118.72
8.3.20.0170.16924.18
8.3.10.0130.21824.66
8.3.00.0000.17726.16
8.2.190.0230.29916.75
8.2.180.0100.32425.92
8.2.170.0000.32222.96
8.2.160.0100.30322.96
8.2.150.0100.18725.66
8.2.140.0070.19824.66
8.2.130.0130.21726.16
8.2.120.0100.18626.16
8.2.110.0070.37622.30
8.2.100.0000.38020.29
8.1.280.0100.34225.92
8.1.270.0030.17524.66
8.1.260.0070.17826.35
8.1.250.0030.18428.09
8.1.240.0100.36318.62
8.1.230.0070.39718.57
8.1.90.0030.25917.45

preferences:
16.07 ms | 401 KiB | 5 Q