When should parameters in PHP functions be passed by reference using the & symbol?

Parameters in PHP functions should be passed by reference using the & symbol when you want to modify the original value of the variable passed as an argument within the function. By default, PHP passes parameters by value, which means that a copy of the variable is passed to the function. However, when passing by reference, any changes made to the parameter within the function will also affect the original variable outside of the function.

function increment(&$num) {
    $num++;
}

$value = 5;
increment($value);
echo $value; // Output: 6