Re: Class methods for custom functions

From: Date: Tue, 04 Dec 2001 10:30:52 +0000
Subject: Re: Class methods for custom functions
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-2112@lists.php.net to get a copy of this message
Andrei Zmievski wrote: > On Mon, 03 Dec 2001, Monte Ohrt wrote: > > I don't like the idea of slowing anything down... Is there a way to get > > around that? > > Ignore my comment. We already use call_user_func_array() so there > wouldn't really be slowdown, except I'd have to serialize the closure > construct and unserialize in _run_mod_handler() and so on. To me, a class method is "theclass::thefunction()". It could be called without having an object instance. Wouldn't it be possible to just register "myclass::funcname" as the name of a custom function? I can't test this right now, so it's just a guess... Well, if it works it only means we can use the namespace encapsulation that classes provide, but that's not too bad ;-) 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 :-) Anyway, sounds cool! Just $0.02. /Anders

« previous php.smarty.general (#2112) next »