http://www.php.net/manual/en/language.references.arent.php
I stopped reading after the manual said "You can't do that", but there's a
user-contributed note on a work-around that you may want to read.
Disclaimer: I don't really grok & in PHP yet, so I just don't use it. :-p
--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Wolfram Kriesing <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, September 14, 2001 10:12 AM
Subject: global variables as reference
> 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
> [EMAIL PROTECTED], 8MB Speicher, Verschluesselung - http://freemail.web.de
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]