为什么“ NOT”按位运算符在PHP中显示输出-1或负数?

时间:2019-11-18 22:09:22

标签: php bitwise-or bitwise-not

我正在按位检查 NOT 运算符,包括Php中的 OR ,但不知道为什么输出为-1。有谁能解释为什么输出是以下代码之一? 在此先感谢

$x = 15;
$y = 3;

echo $x | ~$y;

Output: -1;

0 个答案:

没有答案