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);
Output for git.master_jit
magic const: 55.907ms debug trace: 331.729ms
Output for git.master
magic const: 54.431ms debug trace: 333.744ms
Output for rfc.property-hooks
magic const: 28.526ms debug trace: 143.220ms

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
28.17 ms | 401 KiB | 8 Q