Need Assistance?

support@tutorialshub.in

Functions & Modern PHP Features

Pass by Value vs Pass by Reference (&)

ADVERTISEMENT
PHP Free Lesson
5 min read
ADVERTISEMENT

Normally, PHP passes a copy of a variable into a function (pass by value), so modifying it inside the function doesn't affect the original variable. Prefixing a parameter with & passes a direct reference to the original variable instead.

ADVERTISEMENT
Hi, I'm Tuby! Here to help you