|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-21 12:38 UTC] rael at grad dot icmc dot usp dot br
[2005-03-21 12:58 UTC] tony2001@php.net
[2005-03-30 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 03:00:01 2025 UTC |
Description: ------------ I'm a longer time java programmer, and I'm trying PHP5. But, for my surprise, I saw that static properties cannot be overwrite. Why? This make not sense! Reproduce code: --------------- class a { protected static $v = "aa"; public static function foo(){ echo self::$v; } } class b extends a{ protected static $v = "bb"; public static function foo(){ echo self::$v; } } Expected result: ---------------- No runtime error Actual result: -------------- Cannot redeclare property static protected a::$v in class b