Question discussion

Which of the following is true about passing arguments by reference in PHP functions?

358845Medium DSSSB TGT Computer Science 0 replies 0 views
0
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.
Correct answer: B

Explanation

When a PHP argument is passed by reference (using &), changes made inside the function change the original variable.

Discussion 0

Nobody has replied yet. Start the discussion!