#45743 [Opn->Fbk]: property_exists fails to find static protected member in child class
| From: | jani@php.net | Date: | Thu, 07 Aug 2008 10:18:16 +0000 |
| Subject: | #45743 [Opn->Fbk]: property_exists fails to find static protected member in child class | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-127720@lists.php.net to get a copy of this message | ||
ID: 45743
Updated by: jani@php.net
Reported By: ilewis at uk dot ibm dot com
-Status: Open
+Status: Feedback
-Bug Type: Reflection related
+Bug Type: Scripting Engine problem
Operating System: Fedora 8
PHP Version: 5.3CVS-2008-08-07 (snap)
New Comment:
Send patches in unified diff format. (diff -u)
Previous Comments:
------------------------------------------------------------------------
[2008-08-07 09:57:20] ilewis at uk dot ibm dot com
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 this bug report at http://bugs.php.net/?id=45743&edit=1