3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Vector { private $values; public function populate() { $this->values = range(1, 1_000_000); } public function appendMutable() { $this->values[] = 100_000_001; } public function appendImmutable() { $new = clone $this; $new->values[] = 100_000_001; return $new; } } $v = new Vector(); $v->populate(); $start = microtime(true); $v->appendMutable(); var_dump(microtime(true) - $start); $v = new Vector(); $v->populate(); $start = microtime(true); $v = $v->appendImmutable(); var_dump(microtime(true) - $start);
Output for git.master_jit
float(5.9604644775390625E-6) float(0.007863044738769531)
Output for git.master
float(6.9141387939453125E-6) float(0.009799957275390625)

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:
27.83 ms | 406 KiB | 5 Q