I am having a hard time determining what the =& (equals-ampersand) assignment operator does in PHP. Can anyone explain it? Is it deprecated? Thanks!
+7
A:
It's 2 different operators. =
is assignment as you probably know. and &
means the variable should be accessed by reference rather than by value.
Asaph
2009-11-20 04:32:06
I'm sorry but this is way too simplistic. $a = will also result in $b having a 5. However the reference link may be broken by $b = or unset($b); At which time $a will be the only variable that knows where the cell is that holds the 5. Also beware that if you set $a using = will not break the link, it only replaces the 5 with null;
Don
2010-04-07 01:51:21
@Don: Thanks for the elaboration. I can tell you're a C programmer.
Asaph
2010-04-07 03:26:58
I second what Don says. But I wouldn't say this is way too simplistic. I'd say this is wrong.
Artefacto
2010-08-21 17:11:20