|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-11-28 10:19 UTC] mark-kreine at yandex dot ru
-Status: Open
+Status: Closed
[2012-11-28 10:19 UTC] mark-kreine at yandex dot ru
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 08:00:01 2025 UTC |
Description: ------------ Making method in class static or non-static makes absolutely no sense. For example, let's have a class: class Test { const t = 't'; public function testmethod() { echo self::t; } } Then we do: Test::testmethod() Expecting to see some kind of error, instead I can see normal method execution, finally printing 't'. Adding keyword 'static' to the method declaration makes absolutely no sense. Test script: --------------- class Test { const t = 't'; public static function testmethod() { echo self::t; } } Expected result: ---------------- Some kind of error Actual result: -------------- This script prints "t", that is the contents of the class costant.