|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-03 01:31 UTC] m dot kurzyna at crystalpoint dot pl
[2008-03-03 01:38 UTC] colder@php.net
[2008-03-03 01:46 UTC] m dot kurzyna at crystalpoint dot pl
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 04:00:01 2025 UTC |
Description: ------------ Late static binding doesn't seem to apply to static class variables. Example is rather self explanatory (construtor using static keyword should increment variable in calling class). Reproduce code: --------------- <?php class B { static protected $counter = 0; public function __construct() { ++static::$counter; var_dump(static::$counter); } } class C extends B { public function __construct() { ++static::$counter; var_dump(static::$counter); } } new B; new C; ?> Expected result: ---------------- int(1) int(1) Actual result: -------------- int(1) int(2)