#33438 [Opn->Fbk]: Static/Constant shadowing
| From: | tony2001@php.net | Date: | Wed, 22 Jun 2005 15:56:46 +0000 |
| Subject: | #33438 [Opn->Fbk]: Static/Constant shadowing | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-80837@lists.php.net to get a copy of this message | ||
ID: 33438
Updated by: tony2001@php.net
Reported By: j dot amel83 at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: Class/Object related
Operating System: Win XP, Apache 2.0.54
PHP Version: 5.0.4
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2005-06-22 17:47:41] j dot amel83 at gmail dot com
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 this bug report at http://bugs.php.net/?id=33438&edit=1