note 88110 deleted from function.call-user-func by danbrown
| From: | danbrown@php.net | Date: | Sun, 11 Jan 2009 05:47:37 +0000 |
| Subject: | note 88110 deleted from function.call-user-func by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-149047@lists.php.net to get a copy of this message | ||
Note Submitter: kucerar at hhmi dot org
----
Julian said:
...
You don't need to use this function to call a variable class function. Instead you can do the
following:
$this->{$fnname}();
The example works in PHP 5 from within the class. It is the {} that do the trick.
...
I didn't believe it but it really worked. Just that.
Furthermore outside of the class this also works:
$obj->{$fnname}();
This is very nice to have.
Rich