Re: Re: Static weirdness..
| From: | Herr Witten | Date: | Sat, 21 Feb 2004 02:23:20 +0000 |
| Subject: | Re: Re: Static weirdness.. | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-8032@lists.php.net to get a copy of this message | ||
Well, calling a static method from an instance breaks down the logic. If it is static, then the instance has absolutely no bearing when calling it. Therefore, it logically makes sense to call only from the class name.
Moreover, making a distinction between the method calling syntax begins to make the distinction between class objects and instance objects. I have a class which deals directly with classes and their static methods as if they are objects. This is a powerful notion that still needs more support in the Zend engine.
The call for static method should be:
ClassName->method();
Herr Witten
C++ allows $a->bar() when bar() is a static method (yes, it is called in a static context there too). IMO, there should be no error, warning or notice here.