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!
I need some help wrapping my head around this. I did not write this code, so I am trying to understand why the User Access Control [UAC] is working the way it is.
$a & $b
And
Bits that are set in both $a and $b are set.
If you know binary, 1 & 127 is true because 00000001 = binary 1 and 01111111 = binary 127, and all the set bits (8th 1) are set in binary 127, whereas binary 16 = 00010000, therefore the 8th bit set in binary 1 is not set in binary 16. A quite efficient way to store this information, a single byte .
$a & $b
And
Bits that are set in both $a and $b are set.
If you know binary, 1 & 127 is true because 00000001 = binary 1 and 01111111 = binary 127, and all the set bits (8th 1) are set in binary 127, whereas binary 16 = 00010000, therefore the 8th bit set in binary 1 is not set in binary 16. A quite efficient way to store this information, a single byte .
I was trying to comprehend it as binary; however, I was having issues pin-pointing exactly how it was being figured. Thank you for the prompt explanation!