Assignment

a is set to 1; b is set to a; b is set to 2.

Result

a: 1
b: 2

Explanation

The value of a never changed, b was merely set to the same value as a and then reassigned.


Referencing

a is set to 1; b is referencing a ($b =& $a); b is set to 2.

Result

a: 2
b: 2

Explanation

b is referencing a, so instead of being assigned to the original value of a, changing the value of b changes the value of a because they are equivelent.

References are useful because they can be deleted without removing the refernced value.


Removing a Reference

b has been removed as a reference (unset($b)).

Result

a: 2
b:

Explanation

Because b was originally just a reference, it held no value of its own. Removing the refernce returns an empty variable.