3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo implements Iterator { public string $hook { get => 'this is not the correct value'; } private $x = ['foo', 'BAR']; private $cursor = 0; public function current(): string { return $this->x[$this->cursor]; } public function key(): int { return $this->cursor; } public function next(): void { ++$this->cursor; } public function rewind(): void { $this->cursor = 0; } public function valid(): bool { return isset($this->x[$this->cursor]); } } var_dump(iterator_to_array(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.3.50.0040.00416.87

preferences:
44.78 ms | 493 KiB | 4 Q