note 7022 deleted from Classes and Objects by ronabop

From: Date: Thu, 17 Aug 2000 10:03:48 +0000
Subject: note 7022 deleted from Classes and Objects by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-2174@lists.php.net to get a copy of this message
<PRE> class cool80s { var $prefix; var $sufix; var $name; function cool80s($name) { $this->name = $name; } function makeprefix($number) { $this->prefix = $number; } function makesufix($number) { $this->prefix = $number; } } $Rowland = new cool80s('Jenny'); $Rowland->makeprefix('867'); // works just fine $me = "Rowland"; $$me->makesufix('5309'); // parse error print "Dont forget to call ".$Rowland->name."; print $Rowland->prefix."-".$Rowland->sufix; </PRE> Is it possible to use variable variables for class names?

« previous php.notes (#2174) next »