helly           Mon Oct  3 05:14:30 2005 EDT

  Modified files:              (Branch: PHP_5_1)
    /php-src/ext/spl    spl_array.c 
    /php-src/ext/spl/internal   recursivearrayiterator.inc 
    /php-src/ext/spl/examples   class_tree.php 
  Log:
  - MFH Fix issue with RecursiveArrayIterator::getChildren()
  
http://cvs.php.net/diff.php/php-src/ext/spl/spl_array.c?r1=1.71.2.2&r2=1.71.2.3&ty=u
Index: php-src/ext/spl/spl_array.c
diff -u php-src/ext/spl/spl_array.c:1.71.2.2 
php-src/ext/spl/spl_array.c:1.71.2.3
--- php-src/ext/spl/spl_array.c:1.71.2.2        Sun Sep 18 13:15:03 2005
+++ php-src/ext/spl/spl_array.c Mon Oct  3 05:14:30 2005
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_array.c,v 1.71.2.2 2005/09/18 17:15:03 helly Exp $ */
+/* $Id: spl_array.c,v 1.71.2.3 2005/10/03 09:14:30 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -1186,6 +1186,10 @@
        if (zend_hash_get_current_data_ex(aht, (void **) &entry, &intern->pos) 
== FAILURE) {
                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.2.2&r2=1.1.2.3&ty=u
Index: php-src/ext/spl/internal/recursivearrayiterator.inc
diff -u php-src/ext/spl/internal/recursivearrayiterator.inc:1.1.2.2 
php-src/ext/spl/internal/recursivearrayiterator.inc:1.1.2.3
--- php-src/ext/spl/internal/recursivearrayiterator.inc:1.1.2.2 Sun Sep 18 
13:15:04 2005
+++ php-src/ext/spl/internal/recursivearrayiterator.inc Mon Oct  3 05:14:30 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.2.2&r2=1.1.2.3&ty=u
Index: php-src/ext/spl/examples/class_tree.php
diff -u php-src/ext/spl/examples/class_tree.php:1.1.2.2 
php-src/ext/spl/examples/class_tree.php:1.1.2.3
--- php-src/ext/spl/examples/class_tree.php:1.1.2.2     Sun Oct  2 19:12:35 2005
+++ php-src/ext/spl/examples/class_tree.php     Mon Oct  3 05:14:30 2005
@@ -62,11 +62,6 @@
                }
        }
        
-       function getChildren()
-       {
-               return parent::current();
-       }
-       
        function current()
        {
                return parent::key();

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to