Can someone please explain in detail what these if statements are doing?
What does the three === signs to in the first one, and What does the single & in the second mean?
$aProfile = getProfileInfo($iId);
if($aProfile === false)
return false;
if(!((int)$aProfile['Role'] & $iRole))
return false;
===tests for type-safe equality.'3' == 3will return true, but'3' === 3will not, because one’s a string and one’s an integer. Similarly,null == 0will return true, butnull === 0will not;10.00 == 10will return true, but10.00 === 10will not.&is the bitwise AND operator. It returns a bitmask in which a bit is set if both the corresponding bits are set from the original two bitmasks.For example:
causes 1 to be echoed.
$xis...000101,$yis...010001. The only bit that is set in both of them is the rightmost one, so you get...000001, which is 1.