Hello l0t3k,

  in SPL the iterator classes can be overloaded in TextIterator not.
Foreach does what is necccessary and especially if inside foreach()
someone uses the value it is being copied automatically. Since you do
it all yourself you also need to do the copying yourself. So there is
no inconsistency, just diiferent usage.

regards
marcus

Friday, February 17, 2006, 1:09:37 AM, you wrote:

> Marcus,
>  one last question ...

>> You should never touch the data member of that iterator

> does this mean that i should make a copy of whatever i get from
> the get_current_data() handler ? There seems to be a bit of inconsistency
> in dealing with the current element in the iterators For example, the 
> TextIterator
> reuses the same zval value, whereas the classes in SPL call zval_ptr_dtor()
> between iterations.

> clayton




Best regards,
 Marcus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to