note 95940 deleted from function.current by danbrown
| From: | danbrown@php.net | Date: | Fri, 29 Jan 2010 15:32:52 +0000 |
| Subject: | note 95940 deleted from function.current by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-165495@lists.php.net to get a copy of this message | ||
Note Submitter: adam dot zivner at gmail dot com
----
Thanks Gregory for the solution for the Iterator problem ...
But wouldn't it be simpler if you'd just check key() in valid() method?
public function rewind() { reset($this->data); }
public function current() { return current($this->data); }
public function key() { return key($this->data); }
public function next() { next($this->data); }
public function valid() { return key($this->data) !== null; }