Variables by Reference
| From: | Matt | Date: | Mon, 31 Jul 2000 13:29:48 +0000 |
| Subject: | Variables by Reference | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-9157@lists.php.net to get a copy of this message | ||
Hello, i'm just wondering, if a variable is created
by reference, does that mean that the two variables
are mirrors of each other ? Or does that mean the
creating variable can only change the other and
not the other way round.
Eg.
$init = "hello world";
$init = &$newref;
$newref = "five";
echo $newref; // echos "five";
echo $init; // was mirrored, echos five too
This is a simple example but i'm sure you all know
what i'm talking about, so which is it ? Mirrored
or not ?
Regards, Matt