[PHP] R: [PHP] Interface problem... From: Andrioli Darvin (darvin.andrioli <email protected>)
Date: 09/20/00

"Tristan Rybak" <tristan.rybak <email protected>> wrote in message
NEBBKHDGHKNKKBHPLAFJEELKCBAA.tristan.rybak <email protected>
> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>