Re: Problem with variable functions
| From: | Charles Killian | Date: | Wed, 12 Jul 2000 18:11:01 +0000 |
| Subject: | Re: Problem with variable functions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-6204@lists.php.net to get a copy of this message | ||
Bjorn, try:
$$function();
if that doesn't work, maybe this will:
$function = "classname->sett"
call_user_func($function);
Charles
----- Original Message -----
From: "Björn Schotte" <bjoern@baer.main.de>
To: <php-general@lists.php.net>
Sent: Wednesday, July 12, 2000 11:00 AM
Subject: [PHP] Problem with variable functions
> Hi,
>
> I've got a variable $function:
>
> $function = "\$classname->sett";
>
> And now, I wanted to call the method set with:
>
> $function();
>
> which doesn't work. PHP reports
>
> <b>Fatal error</b>: Call to undefined function: $classname->sett() in
> <b>class.bla.php3</b>
>
> Isn't PHP capable of having variable functions with class methods
> or am I doing something wrong? Any solutions?
>
> TIA, Björn.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>