#45743 [NEW]: property_exists fails to find static protected member in child class
[email protected] ("ilewis at uk dot ibm dot com")
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
From: ilewis at uk dot ibm dot com
Operating system: Fedora 8
PHP version: 5.3CVS-2008-08-07 (snap)
PHP Bug Type: Reflection related
Bug description: property_exists fails to find static protected member in child class
Description:
------------
property_exists() doesn't find a member in a child class when the member
is static and protected.
The code below shows that the member is accessible and should be found by
property_exists.
I've created a patch which I think fixes this, and put it here:
http://pastebin.com/m272f815c
The patch was built against a CVS snap from today:
php5.3-200808070630
Reproduce code:
---------------
<?php
class aParent {
public static function staticTest() {
var_dump(property_exists("A", "prot"));
var_dump(A::$prot);
}
}
class A extends aParent { protected static $prot = "prot"; }
echo "\nparent scope:\n";
aParent::staticTest();
?>
Expected result:
----------------
parent scope:
bool(true)
string(4) "prot"
Actual result:
--------------
parent scope:
bool(false)
string(4) "prot"
--
Edit bug report at http://bugs.php.net/?id=45743&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45743&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45743&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45743&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45743&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45743&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45743&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45743&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45743&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45743&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45743&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45743&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45743&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45743&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45743&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45743&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45743&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45743&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45743&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45743&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45743&r=mysqlcfg