|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-12-20 05:24 UTC] sqchen at citiz dot net
Description: ------------ as php manual says: http://www.php.net/manual/en/language.oop5.static.php if a method is declared as just public, it will be no static method, right? it not, how to declared a no static method Reproduce code: --------------- <?php class A{ public function foo(){ //no static method? echo "[foo]\n";} } public static function static_foo(){//static method? echo "[static_foo]";} } A::foo(); //[foo] A::static_foo(); //[static_foo] ?> Expected result: ---------------- warning: [static_foo] Actual result: -------------- [foo] [static_foo] PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 17 00:00:02 2025 UTC |
sorry , my code is not clearly: and here is the right code: <?php class A{ public function foo() { echo "[foo]\n"; } public static function static_foo() { echo "[static_foo]"; } } A::foo(); A::static_foo(); ?> expected result: warning [static_foo] actual result: [foo] [static_foo]