3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo {} class Foos implements IteratorAggregate { private function __construct(private readonly iterable $foos) {} public static function fromVariadic(Foo ...$foos): self { return new self($foos); } public function getIterator(): \Traversable { return new ArrayIterator($this->foos); } } $foos = Foos::fromVariadic(new Foo, new Foo);

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.4.20.0160.00317.91
8.4.10.0080.00017.55
8.3.150.0060.00317.16
8.3.140.0070.00720.73
8.3.130.0040.00418.55
8.3.120.0040.01220.91
8.3.110.0060.00322.58
8.3.100.0090.00022.58
8.3.90.0130.00622.58
8.3.50.0040.00422.58
8.2.270.0140.00017.05
8.2.260.0070.01119.00
8.2.250.0040.00716.56
8.2.240.0090.00317.30
8.2.230.0040.00422.58
8.2.220.0090.00022.58
8.2.210.0040.00422.58
8.1.310.0040.00416.85
8.1.300.0080.00018.05
8.1.30.0080.00217.61

preferences:
40.78 ms | 403 KiB | 5 Q