Re: indirect function call
| From: | Jesse Swensen | Date: | Wed, 14 Feb 2001 19:56:00 +0000 |
| Subject: | Re: indirect function call | ||
| References: | 1 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-1343@lists.php.net to get a copy of this message | ||
on 2/14/01 9:39 AM, Burak DAYIOGLU at dayioglu@metu.edu.tr wrote:
> Hi,
> We are having a little problem with indirect function calls as being
> discussed on the list for a while... The below thingie does not work,
> does anybody have any idea to make it run?
>
> regards,
> -bd
>
> <?php
>
> class bdd
> {
> var $bdd_var;
> function bdd_function($input)
> {
> echo "This is bdd_function speaking and the input is :
> $input";
> }
> }
>
> $foo = new bdd;
> $bar = $foo->bdd_function;
> $bar("foo bar !");
> ?>
I believe you will have to eval the string, i.e. eval("$bar('foo bar !')");
--
Jesse