Bitwise Operators¶
Bitwise operators evaluate specific bits within an integer.
Bitwise operators are convenient to handle bit fields.
On the other hand, logical operators convert the whole value to boolean before manipulation.
<?php
$a = 3; // binary : 11
$b = 7; // binary : 111
print $a & $b; // 3; binary : 11
?>
See also Are Bitwise Operators Still Relevant in Modern PHP?
Related : Logical Operators