3v4l.org

run code in 300+ PHP versions simultaneously
<?php class it implements OuterIterator { private $inner; public function __construct(Iterator $inner) { $this->inner = $inner; } public function getInnerIterator() { echo "++ inner\n"; return $this->inner; } public function next() { echo "-- Next\n"; return $this->inner->next(); } public function current() { echo "-- Current\n"; return $this->inner->current(); } public function key() { echo "-- Key\n"; return $this->inner->key(); } public function rewind() { echo "-- Rewind\n"; return $this->inner->rewind(); } public function valid() { echo "-- Valid\n"; return $this->inner->valid(); } } $it = new it(new ArrayIterator(array("foo", "bar"))); forach ($it as $key => $value) { echo $value."\n"; }

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)
7.0.00.0030.09020.20
5.6.160.0030.06720.71
5.6.150.0070.07018.25
5.6.140.0030.08318.21
5.6.130.0170.07318.18
5.6.120.0070.08321.01
5.6.110.0130.07021.10
5.6.100.0130.07321.01
5.6.90.0100.05021.14
5.6.80.0100.08020.52
5.5.300.0130.07717.98
5.5.290.0100.07718.08
5.5.280.0000.06320.91
5.5.270.0100.03720.98
5.5.260.0030.07020.80
5.5.250.0070.05020.70
5.5.240.0330.06320.08

preferences:
142.75 ms | 1394 KiB | 7 Q