|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-07 11:54 UTC] sniper@php.net
[2005-09-12 11:37 UTC] dmitry@php.net
[2005-09-12 13:38 UTC] sniper@php.net
[2005-09-17 16:53 UTC] nforbes@php.net
[2020-02-07 06:11 UTC] phpdocbot@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Jan 10 19:00:01 2026 UTC |
Description: ------------ Manual says that static members and methods cannot be redefined in subclasses. It seems that it's not completely true (at least with PHP 5.0.4 under Windows XP), as redefining static methods in subclasses is allowed, and works fine (i.e. without triggering errors even if error level includes E_STRICT). Reproduce code: --------------- class Base { public static function foo() { return 'Foo...'; } } class Extended extends Base { public static function foo() { return 'Bar !!!'; } } echo Extended::foo(); Expected result: ---------------- An error, or the output of Base::foo() Actual result: -------------- It works, and prints 'Bar !!!'