.
Home > Bookmarks, PhP > Bitwise Operators in PhP

Bitwise Operators in PhP

January 20th, 2010 Leave a comment Go to comments
Bitwise OperatorsDescriptionResult
$a & $bAndBits that are set in both $a
and $b are set.
$a | $bOr (inclusive or)Bits that are set in either $a
or $b are set.
$a ^ $bXor (exclusive or)Bits that are set in $a
or $b but not both are set.
$a << $bShift leftShift the bits of $a
$b steps to the left (each step means
“multiply by two”)
$a >> $bShift rightShift the bits of $a
$b steps to the right (each step means
“divide by two”)
~ $aNotBits that are set in $a
are not set, and vice versa.
Categories: Bookmarks, PhP Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.