diff options
author | Marcus Boerger <helly@php.net> | 2005-05-14 16:40:58 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2005-05-14 16:40:58 +0000 |
commit | 626d781afd9adabd299b0df3d441b8e647d74fa4 (patch) | |
tree | f96ba09b57968685ec8f44437cee488821f6e495 /ext/spl | |
parent | 416ea7638d757605506b9ae2df69c314c8a54cd6 (diff) | |
download | php-git-626d781afd9adabd299b0df3d441b8e647d74fa4.tar.gz |
- Execute both RecursiveIteratorIterator::beginChildren() and endChildren()
on the same level (while the actual child is available).
Diffstat (limited to 'ext/spl')
-rwxr-xr-x | ext/spl/internal/recursiveiteratoriterator.inc | 5 | ||||
-rwxr-xr-x | ext/spl/spl_iterators.c | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/ext/spl/internal/recursiveiteratoriterator.inc b/ext/spl/internal/recursiveiteratoriterator.inc index 65f9a20ba9..0e76de21dd 100755 --- a/ext/spl/internal/recursiveiteratoriterator.inc +++ b/ext/spl/internal/recursiveiteratoriterator.inc @@ -164,14 +164,15 @@ class RecursiveIteratorIterator implements OuterIterator return $this->ait[$this->count]->getChildren(); } - /** Called right after calling getChildren() + /** Called right after calling getChildren() and its rewind(). * @since PHP 5.1 */ function beginChildren() { } - /** Called after current child iterator is invalid + /** Called after current child iterator is invalid and right before it + * gets destructed. * @since PHP 5.1 */ function endChildren() diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 879d357374..d8f672cc36 100755 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -251,12 +251,12 @@ next_step: } /* no more elements */ if (object->level > 0) { - iterator->funcs->dtor(iterator TSRMLS_CC); - zval_ptr_dtor(&object->iterators[object->level].zobject); - object->level--; if (object->endChildren) { zend_call_method_with_0_params(&zthis, object->ce, &object->endChildren, "endchildren", NULL); } + iterator->funcs->dtor(iterator TSRMLS_CC); + zval_ptr_dtor(&object->iterators[object->level].zobject); + object->level--; } else { return; /* done completeley */ } |