Re: is Class::$name doable?
| From: | Jon Parise | Date: | Mon, 17 Jul 2000 18:08:18 +0000 |
| Subject: | Re: is Class::$name doable? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-6943@lists.php.net to get a copy of this message | ||
On Mon, Jul 17, 2000 at 07:36:22PM +0300, Teodor Cimpoesu wrote:
> Problem:
> * I want to call a class method by name
> - call_user_method() requires an object
> - call_user_function() doesn't like it
> - $name ='method'; Class::$name() doesn't work.
call_user_func(array('Class', $name));
I believe that will work, but you'll need a recent version of PHP 4.
--
Jon Parise (jon@csh.rit.edu) . Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/ : Computer Science House
Member