php e all e notic,E_ALL ^ E_NOTICE和E_ALL & ~ E_NOTICE

3

There is a difference between ^ and &~, but in this case there is no difference.

是有區別的^ & ~,但在這種情況下沒有區別。

^ means XOR, so bits that are set in either the left operand or the right operand but not both are set in the result. &~ means AND NOT, so bits that are set in the left operand but not in the right operand are set in the result.

^意味着XOR,所以部分設置在右邊左邊的操作數或操作但不都是在結果集。&~表示是否,所以結果中設置了左操作數而不是右操作數中的位。

If we looked at the following numbers, there would be a difference:

如果我們看下面的數字,就會有不同:

$a = 0b1010; // decimal 10

$b = 0b0001; // decimal 1

$a ^ $b results in 0b1011 (decimal 11) whereas $a & ~$b results in 0b1010 (decimal 10).

$ ^ $ b導致0 b1011(十進制11)而& ~ b導致0美元b1010(十進制10)。

However, E_ALL is effectively 0b11111111 (i.e. all the bits are set; it's actually rather more than 8 bits). So XOR is effectively the same as AND NOT.

然而,E_ALL是有效的0b11111111(即所有位都被設置;它實際上比8位多)。所以XOR實際上是相同的,而不是。

$a = 0b11111111; // decimal 255

$b = 0b00000100; // decimal 4

$a ^ $b gives 0b11111011 (decimal 251), as does $a & ~$b.

$ ^ $ b給0 b11111011(十進制251),和$ & ~ $ b。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值