tony2001                Fri Oct  6 18:03:19 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/reflection     php_reflection.c 
    /php-src/ext/reflection/tests       bug39067.phpt 
  Log:
  more improvements
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.28&r2=1.164.2.33.2.29&diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.28 
php-src/ext/reflection/php_reflection.c:1.164.2.33.2.29
--- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.28     Fri Oct  6 
17:35:32 2006
+++ php-src/ext/reflection/php_reflection.c     Fri Oct  6 18:03:19 2006
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_reflection.c,v 1.164.2.33.2.28 2006/10/06 17:35:32 tony2001 Exp $ 
*/
+/* $Id: php_reflection.c,v 1.164.2.33.2.29 2006/10/06 18:03:19 tony2001 Exp $ 
*/
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -4027,12 +4027,12 @@
        prop_name_len = strlen(prop_name);
        ce = tmp_ce = ref->ce;
        while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, prop_name, 
prop_name_len + 1, (void **) &tmp_info) == SUCCESS) {
-               ce = tmp_ce;
-               tmp_ce = tmp_ce->parent;
                if (tmp_info->flags & ZEND_ACC_PRIVATE) {
                        /* it's a private property, so it can't be inherited */
                        break;
                }
+               ce = tmp_ce;
+               tmp_ce = tmp_ce->parent;
        }
 
        zend_reflection_class_factory(ce, return_value TSRMLS_CC);
@@ -4844,7 +4844,7 @@
        php_info_print_table_start();
        php_info_print_table_header(2, "Reflection", "enabled");
 
-       php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 
1.164.2.33.2.28 2006/10/06 17:35:32 tony2001 Exp $");
+       php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 
1.164.2.33.2.29 2006/10/06 18:03:19 tony2001 Exp $");
 
        php_info_print_table_end();
 } /* }}} */
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/bug39067.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/reflection/tests/bug39067.phpt
diff -u php-src/ext/reflection/tests/bug39067.phpt:1.1.2.2 
php-src/ext/reflection/tests/bug39067.phpt:1.1.2.3
--- php-src/ext/reflection/tests/bug39067.phpt:1.1.2.2  Fri Oct  6 17:35:32 2006
+++ php-src/ext/reflection/tests/bug39067.phpt  Fri Oct  6 18:03:19 2006
@@ -24,10 +24,22 @@
 $rc = new ReflectionClass('A');
 var_dump($rc->getProperty('x')->getDeclaringClass()->getName());
 
+class Test {
+       private $x;
+}
+
+class Test2 extends Test {
+       public $x;
+}
+
+$rc = new ReflectionClass('Test2');
+var_dump($rc->getProperty('x')->getDeclaringClass()->getName());
+
 echo "Done\n";
 ?>
 --EXPECTF--    
 string(1) "C"
 string(1) "B"
 string(1) "A"
+string(5) "Test2"
 Done

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

Reply via email to