3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myIterator implements Iterator { private $position = 0; private $array = array( new stdClass(), new stdClass(), new stdClass(), ); public function __construct() { $this->position = 0; } function rewind() { var_dump(__METHOD__); $this->position = 0; } function current() { var_dump(__METHOD__); return $this->array[$this->position]; } function key() { var_dump(__METHOD__); return $this->position; } function next() { var_dump(__METHOD__); ++$this->position; } function valid() { var_dump(__METHOD__); return isset($this->array[$this->position]); } } $i = new myIterator; foreach ($i as $t) { echo $t; }

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.290.0030.04012.50
5.4.280.0020.03912.40
5.4.270.0060.03712.40
5.4.260.0050.03912.40
5.4.250.0070.03612.40
5.4.240.0080.03512.40
5.4.230.0040.04012.39
5.4.220.0090.03512.39
5.4.210.0060.04112.39
5.4.200.0070.03612.39
5.4.190.0090.03812.39
5.4.180.0060.04112.39
5.4.170.0080.03612.40
5.4.160.0080.06512.39
5.4.150.0050.04512.39
5.4.140.0060.04012.08
5.4.130.0080.04012.06
5.4.120.0060.05412.03
5.4.110.0070.05412.02
5.4.100.0090.04512.02
5.4.90.0100.05312.03
5.4.80.0100.05112.02
5.4.70.0050.03912.02
5.4.60.0070.03312.02
5.4.50.0080.03312.02
5.4.40.0080.03412.00
5.4.30.0070.04112.00
5.4.20.0050.03712.00
5.4.10.0060.03712.01
5.4.00.0040.03811.49
5.3.280.0060.03912.71
5.3.270.0090.04012.72
5.3.260.0070.03912.72
5.3.250.0060.03912.71
5.3.240.0050.04012.72
5.3.230.0100.05012.71
5.3.220.0080.04112.68
5.3.210.0070.04312.68
5.3.200.0060.03712.68
5.3.190.0080.03612.68
5.3.180.0100.03312.68
5.3.170.0040.03912.67
5.3.160.0090.03312.67
5.3.150.0040.04112.67
5.3.140.0050.04012.66
5.3.130.0070.03912.66
5.3.120.0120.03812.66
5.3.110.0090.04112.65
5.3.100.0070.05112.12
5.3.90.0090.04712.10
5.3.80.0060.04112.09
5.3.70.0080.03512.09
5.3.60.0040.03912.07
5.3.50.0070.03712.02
5.3.40.0070.03712.02
5.3.30.0060.03711.98
5.3.20.0070.03511.76
5.3.10.0040.03711.75
5.3.00.0080.03511.71

preferences:
138.33 ms | 1386 KiB | 7 Q