3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A implements IteratorAggregate { public $b; public funciton __construct(B $b) { $this->b = $b; } public function getIterator() { return $b; } } class B implements IteratorAggregate { public function getIterator() { for ($i = 0; $i < 5; $i++) { yield $i => $i; } } } $a = new A(new B); foreach ($a as $key => $value) { var_dump($key, $value); }

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)
5.4.270.0070.03812.37
5.4.260.0100.03412.37
5.4.250.0040.04112.38
5.4.240.0090.03912.38
5.4.230.0060.04412.37
5.4.220.0060.03712.37
5.4.210.0070.03412.37
5.4.200.0100.03512.37
5.4.190.0070.03512.36
5.4.180.0120.04712.36
5.4.170.0080.03512.37
5.4.160.0090.03612.36
5.4.150.0050.03812.36
5.4.140.0090.04212.05
5.4.130.0040.03812.03
5.4.120.0060.03911.99
5.4.110.0080.03611.99
5.4.100.0060.04111.99
5.4.90.0060.03811.99
5.4.80.0070.03811.99
5.4.70.0070.03511.98
5.4.60.0060.03811.99
5.4.50.0080.03611.99
5.4.40.0110.04511.98
5.4.30.0080.04911.97
5.4.20.0080.03711.97
5.4.10.0090.04811.97
5.4.00.0080.03611.47
5.3.280.0070.03712.71
5.3.270.0080.04312.72
5.3.260.0080.03812.72
5.3.250.0030.04412.72
5.3.240.0070.03712.72
5.3.230.0060.03912.71
5.3.220.0110.04012.68
5.3.210.0060.04812.68
5.3.200.0050.03712.68
5.3.190.0100.03912.68
5.3.180.0100.04212.67
5.3.170.0090.04812.67
5.3.160.0060.04112.67
5.3.150.0050.03812.67
5.3.140.0070.03512.66
5.3.130.0090.03712.65
5.3.120.0080.03712.66
5.3.110.0070.04812.66
5.3.100.0090.04712.12
5.3.90.0050.04212.08
5.3.80.0070.04612.07
5.3.70.0090.03612.07
5.3.60.0110.04112.07
5.3.50.0050.03812.00
5.3.40.0020.04112.00
5.3.30.0080.03411.95
5.3.20.0060.03611.73
5.3.10.0090.03311.68
5.3.00.0070.03811.67

preferences:
139.99 ms | 1394 KiB | 7 Q