#48286 [NEW]: getDeclaringClass doesn't work with redeclared properties
| From: | Markus dot Lidel at shadowconnect dot com | Date: | Thu, 14 May 2009 20:29:15 +0000 |
| Subject: | #48286 [NEW]: getDeclaringClass doesn't work with redeclared properties | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-137335@lists.php.net to get a copy of this message | ||
From: Markus dot Lidel at shadowconnect dot com
Operating system: Windows
PHP version: 5.3.0RC2
PHP Bug Type: Reflection related
Bug description: getDeclaringClass doesn't work with redeclared properties
Description:
------------
ReflectionProperty::getDeclaringClass() called on derived properties
always return the class where the property was first defined, instead of
the class where the property was redeclared. If $prop is private it works.
(properly related to #39104)
Reproduce code:
---------------
class A
{
protected $prop;
}
class B extends A
{
protected $prop;
}
$rp = new ReflectionProperty('B', 'prop');
echo $rp->getDeclaringClass()->getName();
Expected result:
----------------
B
Actual result:
--------------
A
--
Edit bug report at http://bugs.php.net/?id=48286&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=48286&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=48286&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=48286&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=48286&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=48286&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=48286&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=48286&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=48286&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=48286&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=48286&r=support
Expected behavior: http://bugs.php.net/fix.php?id=48286&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=48286&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=48286&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=48286&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48286&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48286&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=48286&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=48286&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=48286&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=48286&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=48286&r=mysqlcfg