Quick questions on specific operators

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sij
Forum Newbie
Posts: 2
Joined: Mon Aug 23, 2010 8:32 pm

Quick questions on specific operators

Post 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!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Quick questions on specific operators

Post 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.
Post Reply