Re: [PHP-PEAR] indirect function call

[email protected] (Jesse Swensen)
Newsgroups php.pear
Message-ID <B6B04D00.1E81C%[email protected]>
on 2/14/01 9:39 AM, Burak DAYIOGLU at [email protected] 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.