PHP's bitwise operators do not include that symbol

(*-*)浩
Release: 2023-02-28 16:06:02
Original
3445 people have browsed it

PHP's bitwise operators do not include that symbol

#php bitwise operators allow the evaluation and operation of specified bits in an integer.(Recommended Learning:PHP Video Tutorial)

PHPs bitwise operators do not include that symbolSitering 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
Copy after login
rrree

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!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!