lbarnaud Thu May 21 16:01:37 2009 UTC Added files: (Branch: PHP_5_3) /php-src/ext/reflection/tests bug48336.phpt
Modified files: /php-src/ext/reflection php_reflection.c Log: MFH: Fixed bug #48336 (ReflectionProperty::getDeclaringClass() does not work with redeclared property) (patch by Markus dot Lidel at shadowconnect dot com) http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.45.2.56&r2=1.164.2.33.2.45.2.57&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.45.2.56 php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.57 --- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.56 Mon Apr 27 19:48:45 2009 +++ php-src/ext/reflection/php_reflection.c Thu May 21 16:01:37 2009 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.56 2009/04/27 19:48:45 felipe Exp $ */ +/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.57 2009/05/21 16:01:37 lbarnaud Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -4603,6 +4603,10 @@ break; } ce = tmp_ce; + if (tmp_ce == tmp_info->ce) { + /* declared in this class, done */ + break; + } tmp_ce = tmp_ce->parent; } @@ -5438,7 +5442,7 @@ php_info_print_table_start(); php_info_print_table_header(2, "Reflection", "enabled"); - php_info_print_table_row(2, "Version", "$Revision: 1.164.2.33.2.45.2.56 $"); + php_info_print_table_row(2, "Version", "$Revision: 1.164.2.33.2.45.2.57 $"); php_info_print_table_end(); } /* }}} */ @@ -5452,7 +5456,7 @@ NULL, NULL, PHP_MINFO(reflection), - "$Revision: 1.164.2.33.2.45.2.56 $", + "$Revision: 1.164.2.33.2.45.2.57 $", STANDARD_MODULE_PROPERTIES }; /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/bug48336.phpt?view=markup&rev=1.1 Index: php-src/ext/reflection/tests/bug48336.phpt +++ php-src/ext/reflection/tests/bug48336.phpt --TEST-- Bug #48286 (ReflectionProperty::getDeclaringClass() does not work with redeclared properties) --FILE-- <?php class A { } class B extends A { static protected $prop; } class C extends B { static protected $prop; } class D extends C { } class E extends D { } class F extends E { static protected $prop; } $class = 'A'; for($class = 'A'; $class <= 'F'; $class ++) { print($class.' => '); try { $rp = new ReflectionProperty($class, 'prop'); print($rp->getDeclaringClass()->getName()); } catch(Exception $e) { print('N/A'); } print("\n"); } ?> --EXPECT-- A => N/A B => B C => C D => C E => C F => F -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php