Tuesday, April 17, 2012

what is the answer of $a?

$a=2;
$a=$a<<2;
print $a;

ANS : 8.

Explanation:
Bit wise operator in php.
$a << $b Shift left Shift the bits of $a $b steps to the left (each step means "multiply by two")