|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-04-12 11:54 UTC] mike@php.net
[2006-04-12 15:09 UTC] rael at grad dot icmc dot usp dot br
[2006-04-12 19:29 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 01:00:01 2025 UTC |
Description: ------------ Parent class constants are not overriden by sub classes in static methods. Do this override is a common behave, like in Java language. This is a very important feature to construct good class hierarchies. Reproduce code: --------------- <?php class Father{ const NAME = "John"; public static function foo(){ echo self::NAME; } } class Son extends Father{ const NAME = "John Junior"; } Son::foo(); ?> Expected result: ---------------- Output of "John Junior" Actual result: -------------- Output of "John"