Which of the following is true about passing arguments by reference in PHP functions?
AArguments passed by reference cannot be modified within the function.
BThe original value of the argument is changed when passed by reference.
CPHP does not support passing arguments by reference.
DArguments passed by reference must be of type array.
Show answerHide answer
Correct answer: (B) The original value of the argument is changed when passed by reference.
Explanation
In PHP, a parameter declared with & (function f(&$x)) is a reference to the caller's variable, so changing it inside the function changes the original value. Any type can be passed by reference.