R: [PHP] Interface problem...
| From: | Andrioli Darvin | Date: | Wed, 20 Sep 2000 19:46:11 +0000 |
| Subject: | R: [PHP] Interface problem... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-17264@lists.php.net to get a copy of this message | ||
"Tristan Rybak" <tristan.rybak@e-point.pl> wrote in message
NEBBKHDGHKNKKBHPLAFJEELKCBAA.tristan.rybak@e-point.pl...
> Hello gurus...
> I am going to create a system (in php) of loadable modules similar to
> Win32/COM. I am working on interface system and I want to use a "Variable
> functions" feature for it. Unfortunately it doesn't work for class
methods.
> Here is a code:
>
> <?php
> class Test {
> var $varFunc = "func1";
>
> function func1() {
> echo "exec: func1";
> }
> }
>
> $t = new Test;
>
> $t->varFunc();
> ?>
>
The following statement should work with your example.
eval("\$t->" . $t->varFunc ."();");
Bye
Darvin