The reference assignment of variables in PHP is carried out through the & symbol, where we introduce the role of the 1 & symbol Introduction. First introduction to the delivery assignment <?php $a =1; $b = 3; from memory point of view: $a point to an address, the corresponding data is 1 $b point An address, the corresponding data is 3 $a = $b; Now execute $a= $b is to assign a value in $b to $ A then $a =3 & nbsp echo $a, $b,//3 3 So the value of two variables is 3 3 >2. Reference Assignment <?php $a =1; $b =2; $a =& $b; This is now done by assigning the address of B to $ A $a a reference to the same two variables as the address of $b to the same memory space data is 2 echo $a $b//2 2 and nbsp , &NB Sp unset ($b);
variable has a mechanism if there are multiple variables pointing to the same address canceling one of the variables other variables are not affectedecho $a;//2 >
01PHP reference assignment and pass assignment