#32331 [NEW]: Why static properties cannot be overwrite?
| From: | rael at grad dot icmc dot usp dot br | Date: | Wed, 16 Mar 2005 10:58:14 +0000 |
| Subject: | #32331 [NEW]: Why static properties cannot be overwrite? | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-76786@lists.php.net to get a copy of this message | ||
From: rael at grad dot icmc dot usp dot br
Operating system: Windows XP Professional SP2
PHP version: 5.0.1
PHP Bug Type: Feature/Change Request
Bug description: Why static properties cannot be overwrite?
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
--
Edit bug report at http://bugs.php.net/?id=32331&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32331&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32331&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32331&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32331&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32331&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32331&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32331&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32331&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32331&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32331&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32331&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32331&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32331&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32331&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32331&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32331&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32331&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32331&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32331&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32331&r=mysqlcfg