#47620 [NEW]: Weird static keyword behaviour
| From: | olemarkus dot with at student-media dot no | Date: | Wed, 11 Mar 2009 07:18:24 +0000 |
| Subject: | #47620 [NEW]: Weird static keyword behaviour | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-134587@lists.php.net to get a copy of this message | ||
From: olemarkus dot with at student-media dot no
Operating system: Linux
PHP version: 5.3CVS-2009-03-11 (snap)
PHP Bug Type: Class/Object related
Bug description: Weird static keyword behaviour
Description:
------------
When using static:: in a parent class to refer to the child class that was
called, the keyword is resolved to the caller class instead.
Reproduce code:
---------------
http://olemarkus.com/issue.txt
Expected result:
----------------
I expect both calls to \C\C::getName() to yield the same result:
C
C
Actual result:
--------------
The second one gives the following output:
C
Fatal error: Access to undeclared static property: A\A::$name in issue.php
on line 13
--
Edit bug report at http://bugs.php.net/?id=47620&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=47620&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=47620&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=47620&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=47620&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47620&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=47620&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=47620&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=47620&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=47620&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=47620&r=support
Expected behavior: http://bugs.php.net/fix.php?id=47620&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=47620&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=47620&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=47620&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47620&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47620&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=47620&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=47620&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=47620&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=47620&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=47620&r=mysqlcfg