Re: Class methods for custom functions
| From: | Anders Janson | Date: | Tue, 04 Dec 2001 16:01:24 +0000 |
| Subject: | Re: Class methods for custom functions | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2120@lists.php.net to get a copy of this message | ||
Andrei Zmievski wrote:
>
> > Here I get the impression that you were talking about registering
> > $theobject->thefunction(). This is certainly a method in a class, but IMHO
> > it is not a class method. At least that's what my C++/OOP teachers told me
> > :-)
>
> Umm, what is it then? An object instance method?
Erhmm.... that's a very good question. Object instance method... uhm, yes, but
it sounds strange. I think my teachers just called those "methods". A *class*
method (and class variable) is special, related to the class, and not objects
instantiated from the class.
But that was C++, and the OOP in PHP sucks anyway, so the terminology might not
be relevant. Never mind :-)
> Anyway, what I meant is
> registering either static methods or instance-based ones.
OK!
> They would all
> work, but it may result in a slight slowdown. Of course if you use
> cache, it is obviated.
Maybe the compiler could detect the old plain function style, and generate old,
fast code there?
I don't mind much if the compile time increases a little, but page generation
thereafter should be as fast as it possibly can be.
/Anders