Re: execute methods dynamically
| From: | Rainer Hahnekamp | Date: | Sun, 20 Mar 2005 18:19:50 +0000 |
| Subject: | Re: execute methods dynamically | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-211143@lists.php.net to get a copy of this message | ||
Sorry my fault. It's working of course.
Am Sun, 20 Mar 2005 18:47:20 +0100 schrieb Rainer Hahnekamp:
> Hello everybody,
>
> I want to write a method in version 4 that executes a method of an object.
> As parameter the classname and the methodname is passed:
>
> function executeMethod($classname, $methodname) {
> $object = new $classname();
> $object->$methodname();
> }
>
> This does not work. What am I doing wrong?
>
> Greetings,
> -Rainer Hahnekamp