3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Cl { public $v = ['foo']; public function a(): array { return $this->v; } public function &b(): array { return $this->v; } } $o = new Cl(); $iters = 1_000_000; $t = microtime(true); for ($i = 0; $i < $iters; $i++) { $v1 = $o->a(); $v2 = $o->a(); $v3 = $o->a(); $v4 = $o->a(); $v1 = $o->a(); $v2 = $o->a(); $v3 = $o->a(); $v4 = $o->a(); } var_dump(microtime(true) - $t); $t = microtime(true); for ($i = 0; $i < $iters; $i++) { $v1 = $o->b(); $v2 = $o->b(); $v3 = $o->b(); $v4 = $o->b(); $v1 = $o->b(); $v2 = $o->b(); $v3 = $o->b(); $v4 = $o->b(); } var_dump(microtime(true) - $t);
Output for git.master
float(0.1998891830444336) float(0.2135179042816162)
Output for git.master_jit
float(0.18172287940979004) float(0.22260713577270508)

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:
39.46 ms | 401 KiB | 7 Q