note 9181 deleted from Variable variables by ronabop

From: Date: Sat, 10 Mar 2001 23:36:52 +0000
Subject: note 9181 deleted from Variable variables by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-12240@lists.php.net to get a copy of this message
If varialbe array name names work why not variable object names? For example: class Schlemiel { var $aVar = "foo"; } $schlemazel[5] = "oof"; $schlemiel = new Schlemiel; $a = "schlemiel"; $b = "schlemazel"; echo "This works: ".${$b}[5]."<BR>"; echo "So does this: ".$schlemiel->aVar."<BR>"; echo "But this doesn't: ".${$a}->aVar."<BR>"; echo "Nor does this: ".${"schlemiel"}->aVar."<BR>"; Thanks, -kristi

« previous php.notes (#12240) next »