note 9451 modified in Variable variables by ronabop
| From: | ronabop@php.net | Date: | Sat, 10 Mar 2001 23:37:05 +0000 |
| Subject: | note 9451 modified in Variable variables by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-12241@lists.php.net to get a copy of this message | ||
There is no need for the braces for variable object names...they are only needed by an ambiguity
arises concerning which part of the reference is variable...usually with arrays.
class Schlemiel {
var $aVar = "foo";
}
$schlemiel = new Schlemiel;
$a = "schlemiel";
echo $$a->aVar;
This code outputs "foo" using PHP 4.0.3.
Hope this helps...
- Jordan
http://www.php.net/manual/variable-variables.php