helly Sat May 14 12:40:58 2005 EDT
Modified files:
/php-src/ext/spl spl_iterators.c
/php-src/ext/spl/internal recursiveiteratoriterator.inc
Log:
- Execute both RecursiveIteratorIterator::beginChildren() and endChildren()
on the same level (while the actual child is available).
http://cvs.php.net/diff.php/php-src/ext/spl/spl_iterators.c?r1=1.68&r2=1.69&ty=u
Index: php-src/ext/spl/spl_iterators.c
diff -u php-src/ext/spl/spl_iterators.c:1.68
php-src/ext/spl/spl_iterators.c:1.69
--- php-src/ext/spl/spl_iterators.c:1.68 Thu Mar 31 16:49:47 2005
+++ php-src/ext/spl/spl_iterators.c Sat May 14 12:40:56 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_iterators.c,v 1.68 2005/03/31 21:49:47 helly Exp $ */
+/* $Id: spl_iterators.c,v 1.69 2005/05/14 16:40:56 helly Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -251,12 +251,12 @@
}
/* 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 */
}
http://cvs.php.net/diff.php/php-src/ext/spl/internal/recursiveiteratoriterator.inc?r1=1.10&r2=1.11&ty=u
Index: php-src/ext/spl/internal/recursiveiteratoriterator.inc
diff -u php-src/ext/spl/internal/recursiveiteratoriterator.inc:1.10
php-src/ext/spl/internal/recursiveiteratoriterator.inc:1.11
--- php-src/ext/spl/internal/recursiveiteratoriterator.inc:1.10 Sat Mar 12
18:21:41 2005
+++ php-src/ext/spl/internal/recursiveiteratoriterator.inc Sat May 14
12:40:58 2005
@@ -164,14 +164,15 @@
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()
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php