global variables as reference

From: Date: Fri, 14 Sep 2001 15:12:25 +0000
Subject: global variables as reference
Groups: php.general 
Request: Send a blank email to php-general+get-67377@lists.php.net to get a copy of this message
i am using a global variable (curClass), which is a reference to some class, inside another class i want to change the value of this global variable, to "point" or refer to another class. but that doesnt work. am i doing something wrong??? here my code ------------------ class temp { function temp() { global $curClass; $curClass = &${$classNameY}; } } ------------- $curClass = &${classNameX}; $tempi = new temp(); # at this point $curClass still points # to the class with the name "classNameX" # not to "classNameY" as i would suppose # if i used: $curClass = $classNameY; # inside the class temp # $curClass would have the expected value # but with the "&${}" around it doenst work thanks 4 your help Wolfram Kriesing _______________________________________________________________________ 1.000.000 DM gewinnen - kostenlos tippen - http://millionenklick.web.de IhrName@web.de, 8MB Speicher, Verschluesselung - http://freemail.web.de

« previous php.general (#67377) next »