Value Assignment: The value of the argument is assigned to the row parameter, and the modification of the row parameter does not affect the value of the argument.
For example: root copy is the same. For example, I have one? H House, I give you building materials, you built a house that is identical to my house, what you do in your house will not affect me, what I do in my house will not affect you, independent of each other.
The code is as follows |
Copy Code |
$AA = 1; $BB = 2; $AA = $BB//$AA and $BB are irrelevant to each other. $AA = 3; Echo $aa, '--', $BB//Output 3--2 |
Reference Assignment: when the actual address passes the parameter pass, the row and the arguments are the same object, but their names are different. Changes to a row parameter affect the value of the argument
For example: It reminds me of the pointer to learning C when I was in college. For example, I have one? H House, I give you a key, we all two can enter this House, what you do in the House will affect me.
code is as follows |
copy code |
$aa =1; $BB = 2; $aa =& $BB//$BB references to $AA, regardless of $aa, or $bb change to each other $aa =3; Echo $aa, '--', $BB;/output 3--3 |