3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Example implements Iterator { public $i = 0; public $prop = 'pie'; public function rewind() { $this->i = 0;} public function next() {} public function valid() { return ($this->i++ < 5); } public function key() { return 7; } public function current() { return $this->prop; } } $it = new Example; foreach ($it as &$current) { $current = str_rot13($current); } var_dump($it);

preferences:
35.86 ms | 402 KiB | 5 Q