#33438 [NEW]: Static/Constant shadowing
| From: | j dot amel83 at gmail dot com | Date: | Wed, 22 Jun 2005 15:47:42 +0000 |
| Subject: | #33438 [NEW]: Static/Constant shadowing | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-80835@lists.php.net to get a copy of this message | ||
From: j dot amel83 at gmail dot com
Operating system: Win XP, Apache 2.0.54
PHP version: 5.0.4
PHP Bug Type: Class/Object related
Bug description: Static/Constant shadowing
Description:
------------
There is no way to shadowing (redeclare with another initialize value) the
parent static/constant variables in the subclasses
Reproduce code:
---------------
<?php
class Test1 {
protected static $MAX = 100;
}
class Test2 extends Test1 {
protected static $MAX = 200;
}
?>
Actual result:
--------------
Fatal error: Cannot redeclare property static protected Test1::$MAX in
class Test2 in D:\WebServerRoot\FrameWork\test.php on line 7
--
Edit bug report at http://bugs.php.net/?id=33438&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33438&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33438&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33438&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33438&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33438&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33438&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33438&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33438&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33438&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33438&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=33438&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=33438&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33438&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33438&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33438&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33438&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33438&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33438&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33438&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33438&r=mysqlcfg