By reference
| From: | Chris Boget | Date: | Thu, 13 Feb 2003 20:56:44 +0000 |
| Subject: | By reference | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-135517@lists.php.net to get a copy of this message | ||
I thought I understood this but evidently not...
Consider the following:
$firstVar = "123ABC";
$secondVar &= $firstVar;
$thirdVar = &$firstVar;
echo $secondVar;
echo '<br>';
echo $thirdVar;
When I echo $secondVar, I get '0' but when I echo $thirdVar,
I get the value of $firstVar.
Why? I thought that "&=" made it so that the left operand was
pointing to the memory location of the right?
Chris