note 88185 added to language.oop5.static
| From: | eandre at omeco dot de | Date: | Wed, 14 Jan 2009 12:16:31 +0000 |
| Subject: | note 88185 added to language.oop5.static | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-149185@lists.php.net to get a copy of this message | ||
class Foo {
public static function get() {
echo "foo";
}
}
print Foo::get(); // outputs foo - this is the it should work
$foo = new Foo;
print $foo->get(); // outputs foo also - this should not be able to work. is it a bug?
why is it possible to call a method signed as static. static methods are used with classes, am i
right?
may it be, that i could call static methods with an object, where the class signature isnt abstract?
----
Server IP: 217.160.72.57
Probable Submitter: 195.145.144.39
----
Manual Page -- http://www.php.net/manual/en/language.oop5.static.php
Edit -- https://master.php.net/note/edit/88185
Del: integrated -- https://master.php.net/note/delete/88185/integrated
Del: useless -- https://master.php.net/note/delete/88185/useless
Del: bad code -- https://master.php.net/note/delete/88185/bad+code
Del: spam -- https://master.php.net/note/delete/88185/spam
Del: non-english -- https://master.php.net/note/delete/88185/non-english
Del: in docs -- https://master.php.net/note/delete/88185/in+docs
Del: other reasons-- https://master.php.net/note/delete/88185
Reject -- https://master.php.net/note/reject/88185
Search -- https://master.php.net/manage/user-notes.php