When we use only one & it means bit-by-bit and operation, so $a & $b=10 (1010b), while when you use && it means and operator of clauses and in this case $a && $b = 0, cause $b=0.
Beware of the signs. This FAQ is also valid for the or operator ('|').
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.