|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-03-02 14:42 UTC] laruence@php.net
[2013-03-02 14:42 UTC] laruence@php.net
-Status: Open
+Status: Not a bug
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 17:00:01 2025 UTC |
Description: ------------ If you extend a class, which has a static property, and set that static property, it will overwrite the variable in the parent, not in the child. Test script: --------------- <?php class One { public static $var = 'hi'; } class Two extends One { public static function set($var) { static::$var = $var; } } Two::set('bye'); var_dump(One::$var); Expected result: ---------------- "hi" Actual result: -------------- "bye"