PHP different usage of reference sign &
I have a question regarding the different usage of & in the following two examples:
$x = &$b; // which I know what it does
But what about this one:
$x &= get_instance();
&= is the "bitwise and"-assignment operator. In PHP
$a &= $b;
is the same as
$a = $a & $b;
"bitwise and" means that two corresponding bits of two arguments are evaluated using the and-operator. If the arguments are not integers, they are converted to integer values first. For details you can refer to the php manual.
链接地址: http://www.djcxy.com/p/57598.html上一篇: 为什么我应该在PHP中使用bitwise / bitmask?
下一篇: PHP不同用法的参考符号&