Re: Iterators?
| From: | l0t3k | Date: | Mon, 23 Jun 2003 03:25:57 +0000 |
| Subject: | Re: Iterators? | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-17631@lists.php.net to get a copy of this message | ||
Harry,
perhaps you havent heard about SPL ?
http://cvs.php.net/co.php/spl/
check out the readme and examples. only thing is that its for PHP5.
l0t3k
"Harry Fuecks" <hfuecks@phppatterns.com> wrote in message
news:oprq642qulq6i4c6@localhost...
> On Mon, 23 Jun 2003 08:41:27 +0800, Alan Knowles <alan@akbkhome.com>
wrote:
>
> One iterator I came across recently which I thought was interesting as it
> manages to
> provide an API more or less common to an indexed iterator while still
> deferring to the
> sequences PHP maintains looks something like this;
>
> <?php
> class ArrayIterator {
> var $atStart = true;
> var $array;
> var $element;
> function ArrayIterator($array) {
> $this->array = $array;
> }