property_exists fails to find static protected member in child class
| Bug #45743 | property_exists fails to find static protected member in child class | ||||
|---|---|---|---|---|---|
| Submitted: | 2008-08-07 09:57 UTC | Modified: | 2008-08-19 19:58 UTC | ||
| From: | ilewis at uk dot ibm dot com | Assigned: | felipe (profile) | ||
| Status: | Closed | Package: | Class/Object related | ||
| PHP Version: | 5.3CVS-2008-08-07 (snap) | OS: | Fedora 8 | ||
| Private report: | No | CVE-ID: | None | ||
[2008-08-07 09:57 UTC] 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"
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2008-08-07 10:18 UTC] jani@php.net
[2008-08-07 12:36 UTC] ilewis at uk dot ibm dot com
[2008-08-15 01:00 UTC] php-bugs at lists dot php dot net
[2008-08-18 10:20 UTC] ilewis at uk dot ibm dot com
[2008-08-18 16:51 UTC] felipe@php.net
[2008-08-18 17:50 UTC] felipe@php.net
[2008-08-19 08:11 UTC] ilewis at uk dot ibm dot com
[2008-08-19 11:01 UTC] felipe@php.net