3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeIterator implements Iterator{ function rewind(){ $this->x = 0; } function next(){ $this->x++; } function valid(){ return $this->x < 10; } function key(){ echo "key"; } function current(){ echo "current"; } } foreach(new SomeIterator as $value);

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
165.55 ms | 2808 KiB | 10 Q