Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Iterator implements Iterator {
- protected $data;
- public function __construct($data) {
- $this->data = $data;
- }
- function rewind() {
- return reset($this->data);
- }
- function current() {
- return current($this->data);
- }
- function key() {
- return key($this->data);
- }
- function next() {
- return next($this->data);
- }
- function valid() {
- return !is_null(key($this->myArray));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement