What is the function of & like in context of why 4 & 3 in php is 0 like how is it works | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the function of & like in context of why 4 & 3 in php is 0 like how is it works

2nd Jun 2022, 3:53 PM
Twistzzzz
Twistzzzz - avatar
1 Answer
+ 2
Example: Input: $First = 5, $Second = 3 Output: The bitwise & of both these value will be 1. Explanation: Binary representation of 5 is 0101 and 3 is 0011. Therefore their bitwise & will be 0001 (i.e. set if both first and second have their bit set.) Now you can try with 4 & 3
2nd Jun 2022, 6:27 PM
JaScript
JaScript - avatar