Using a Function without a Reference

A function has been created which takes a parameter and then muliplies that by 2.

A variable has been created and set to 10.

Result

Variable value: 10
Variable value after function call: 10

Explanation

The function used local variables to change the value, which did nothing for the global variable.


Using a Function with a Reference

A function has been created which takes a referenced parameter (&$var) and then multiplies it by 2.

A variable has been created and set to 10.

Result

Variable value: 10
Variable value after function call: 20

Explanation

In this case, the argument being multiplied in the function was a reference, so it updated the value of the variable.