I have the following code snippet:
$a = '1';
$b = &$a;
$b = "2$b";
echo $a.", ".$b;
Output:
21, 21
I noticed that there is no assignment to the variable $a
except for the fact that $b = &$a
using &
, that in the end, the result is changed. I did not understand very well, so I wonder:
What does &
mean for this situation? What would be the goal? And at what point is this used?