variable variables with classes
| From: | Cynic | Date: | Mon, 11 Sep 2000 01:16:03 +0000 |
| Subject: | variable variables with classes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16101@lists.php.net to get a copy of this message | ||
What's the correct syntax for variable variables used in
classes?
I wanted to use a generic handler for class variables:
function setProperty( $var , $val )
{
$this->$$var = $val ;
}
but this doesn't do anything except a warning.
____________________________________________________________
Cynic:
A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.
cynic@mail.cz
ICQ: 2808 2505