#php bitwise operators allow the evaluation and operation of specified bits in an integer.(Recommended Learning:PHP Video Tutorial)
Sitering is a mathematical operation in PHP.Bits moved out in any direction are discarded. When shifting left, the right side is padded with zeros, and the sign bit is moved away, meaning that the sign is not preserved. When shifting right, the left side is padded with sign bits, which means the sign is preserved.
Use parentheses to ensure the desired priority. For example, $a & $b == true performs comparison first and then performs bitwise AND; while ($a & $b) == true performs bitwise AND first and then performs comparison.
If the two operands of &, | | and ^ operators are strings, the operation will be performed on the ASCII values of the characters that make up the string, and the result will be a string. In all other cases, both operands will be converted to integers and the result will be an integer.
If the operand of the ~ operator is a string, the operation will be performed on the ASCII values of the characters that make up the string and the result will be a string, otherwise the operand and result will be treated as integers.
The operands and results of the > operators are always treated as integers.
PHP 的 ini 设定 error_reporting 使用了按位的值, 提供了关闭某个位的真实例子。要显示除了提示级别 之外的所有错误,php.ini 中是这样用的: E_ALL & ~E_NOTICE
The above is the detailed content of PHP's bitwise operators do not include that symbol. For more information, please follow other related articles on the PHP Chinese website!