note 13540 deleted from language.variables.variable by danbrown
| From: | danbrown@php.net | Date: | Wed, 24 Jun 2009 17:02:31 +0000 |
| Subject: | note 13540 deleted from language.variables.variable by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-157422@lists.php.net to get a copy of this message | ||
Note Submitter: phil at NO^SPAMw30wnzj00 dot com
----
Expanding on the variable function note a bit:
when using variable methods the syntax is a bit different. to call a function whose name is
contained in $var_func:
$this->$var_func($parm1, $parm2);
thus...
class A
{
function f1($parm){echo $parm;}
}
$objA = new A();
$var_func = 'f1';
$objA->$var_func("moo");
produces 'moo'