Re: [PHP] By reference

2003-02-13 Thread Chris Wesley
On Thu, 13 Feb 2003, Chris Boget wrote: > $firstVar = "123ABC"; > > $secondVar &= $firstVar; &= is a bitwise AND, and an assignment. This didn't do what you expected it to do. > $thirdVar = &$firstVar; =& is a reference assignment. This did what you expected it to do. > Why? I thought that "&

[PHP] By reference

2003-02-13 Thread Chris Boget
I thought I understood this but evidently not... Consider the following: $firstVar = "123ABC"; $secondVar &= $firstVar; $thirdVar = &$firstVar; echo $secondVar; echo ''; echo $thirdVar; When I echo $secondVar, I get '0' but when I echo $thirdVar, I get the value of $firstVar. Why? I thought