Possible Duplicate:
Reference - What does this symbol mean in PHP?
Can someone tell me what's the << 0
for? and other more common alternatives if they exist
$newvalue += 1 << 0;
Possible Duplicate:
Reference - What does this symbol mean in PHP?
Can someone tell me what's the << 0
for? and other more common alternatives if they exist
$newvalue += 1 << 0;
<<
is the bitwise left-shift operator.
In this case is seems pretty pointless, since left-shifting 1 by 0 equals 1.
<< 0 does nothing. It is probably there to indicate that the value is some sort of flag. If it was something other than 0, than it would shift the value (1) left by x bits, where is is the value replacing 0.