Page 1 of 1

Quick questions on specific operators

Posted: Sun Sep 26, 2010 9:59 am
by sij
Hello,

For the life of me I can't find the resources describing the following two operators: &=, =&
And running my own tests aren't very clear, either.

Can someone help me out?
Thanks!

Re: Quick questions on specific operators

Posted: Sun Sep 26, 2010 10:04 am
by requinix
$x &= $y is shorthand for $x = $x & $y, and in that situation the & acts as a bitwise AND.
$x =& $y is assignment-by-reference. Rather than $x being a copy of $y, it's a reference: the two variables are identical in basically every way.