<?php class It implements Iterator { private $arr = [1,2,3]; public function key() { echo __METHOD__ . "\n"; return key($this->arr); } public function current() { echo __METHOD__ . "\n"; return current($this->arr); } public function rewind() { echo __METHOD__ . "\n"; reset($this->arr); } public function next() { echo __METHOD__ . "\n"; next($this->arr); } public function valid() { echo __METHOD__ . "\n"; return key($this->arr) !== null; } } $it = new It; foreach ($it as $k => $v) {}
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`