variable variables in classes
| From: | news.php.net | Date: | Tue, 05 Sep 2000 02:19:03 +0000 |
| Subject: | variable variables in classes | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-15203@lists.php.net to get a copy of this message | ||
Problem:
How do I use variable variables in a class?
For instance:
class example {
var $test = Hello;
function output() {
printf($this->{$this->test});
}
}
$var = new example;
$var->output(); \\ It doen'tt work!
Thanks for your help!