PHP等于和运营商

可能重复:
参考 - 这个符号在PHP中的含义是什么?
php中的“=&”/“&=”运算符是什么意思?

对不起,我觉得我要求的问题太简单了,但在PHP中是什么=&? 我试图在Cakephp中使用ACL的ACL功能...


当您想要通过引用分配变量时,可以使用=& 。 欲了解更多信息,请参阅http://php.net/manual/en/language.references.php。

例:

$a = array(1, 2, 3);
// $b is a reference to $a.
// If you change $a or $b, the value for both $a and $b will be changed.
$b =& $a;

$c = array(1, 2, 3);
// $d is a copy of $c.
// If you change $d, $c remains unchanged.
$d = $c;

$b = 3;
$a =& $b;
$b = 5; //$a is 5 now
$a = 7; //$b is 7 now
链接地址: http://www.djcxy.com/p/57587.html

上一篇: PHP equals and operators

下一篇: What does the PHP operator =& mean?