|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33438 Static/Constant shadowing
Submitted: 2005-06-22 17:47 UTC Modified: 2005-06-30 01:00 UTC
From: j dot amel83 at gmail dot com Assigned:
Status: No Feedback Package: Class/Object related
PHP Version: 5.0.4 OS: Win XP, Apache 2.0.54
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: j dot amel83 at gmail dot com
New email:
PHP Version: OS:


 [2005-06-22 17:47 UTC] j dot amel83 at gmail dot com
There is no way to shadowing (redeclare with another initialize value) the parent static/constant variables in the subclasses

Reproduce code:
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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-22 17:56 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-06-30 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Jun 06 16:03:37 2023 UTC