cvs: php-src /ext/spl spl_array.c /ext/spl/examples class_tree.php /ext/spl/internal recursivearrayiterator.inc
| From: | Marcus Boerger | Date: | Mon, 03 Oct 2005 09:12:39 +0000 |
| Subject: | cvs: php-src /ext/spl spl_array.c /ext/spl/examples class_tree.php /ext/spl/internal recursivearrayiterator.inc | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-34240@lists.php.net to get a copy of this message | ||
helly Mon Oct 3 05:12:39 2005 EDT
Modified files:
/php-src/ext/spl spl_array.c
/php-src/ext/spl/internal recursivearrayiterator.inc
/php-src/ext/spl/examples class_tree.php
Log:
- Fix issue with RecursiveArrayIterator::getChildren()
http://cvs.php.net/diff.php/php-src/ext/spl/spl_array.c?r1=1.80&r2=1.81&ty=u
Index: php-src/ext/spl/spl_array.c
diff -u php-src/ext/spl/spl_array.c:1.80 php-src/ext/spl/spl_array.c:1.81
--- php-src/ext/spl/spl_array.c:1.80 Mon Sep 19 03:49:10 2005
+++ php-src/ext/spl/spl_array.c Mon Oct 3 05:12:38 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spl_array.c,v 1.80 2005/09/19 07:49:10 dmitry Exp $ */
+/* $Id: spl_array.c,v 1.81 2005/10/03 09:12:38 helly Exp $ */
#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -1204,6 +1204,10 @@
return;
}
+ if (Z_TYPE_PP(entry) == IS_OBJECT && instanceof_function(Z_OBJCE_PP(entry),
Z_OBJCE_P(getThis()) TSRMLS_CC)) {
+ RETURN_ZVAL(*entry, 0, 0);
+ }
+
spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), &return_value, 0, *entry TSRMLS_CC);
}
/* }}} */
http://cvs.php.net/diff.php/php-src/ext/spl/internal/recursivearrayiterator.inc?r1=1.1&r2=1.2&ty=u
Index: php-src/ext/spl/internal/recursivearrayiterator.inc
diff -u php-src/ext/spl/internal/recursivearrayiterator.inc:1.1
php-src/ext/spl/internal/recursivearrayiterator.inc:1.2
--- php-src/ext/spl/internal/recursivearrayiterator.inc:1.1 Sun Sep 18 07:34:36 2005
+++ php-src/ext/spl/internal/recursivearrayiterator.inc Mon Oct 3 05:12:39 2005
@@ -13,7 +13,7 @@
* @brief A recursive array iterator
* @author Marcus Boerger
* @version 1.0
- * @since PHP 6.0
+ * @since PHP 5.1
*
* Passes the RecursiveIterator interface to the inner Iterator and provides
* the same functionality as FilterIterator. This allows you to skip parents
@@ -42,6 +42,10 @@
*/
function getChildren()
{
+ if ($this->current() instanceof self)
+ {
+ return $this->current();
+ }
if (empty($this->ref))
{
$this->ref = new ReflectionClass($this);
http://cvs.php.net/diff.php/php-src/ext/spl/examples/class_tree.php?r1=1.1&r2=1.2&ty=u
Index: php-src/ext/spl/examples/class_tree.php
diff -u php-src/ext/spl/examples/class_tree.php:1.1 php-src/ext/spl/examples/class_tree.php:1.2
--- php-src/ext/spl/examples/class_tree.php:1.1 Sun Oct 2 19:12:12 2005
+++ php-src/ext/spl/examples/class_tree.php Mon Oct 3 05:12:39 2005
@@ -62,11 +62,6 @@
}
}
- function getChildren()
- {
- return parent::current();
- }
-
function current()
{
return parent::key();