Hello guys,
does anybody know what is the difference when you assign attributes like...
function mytest (&$par1)
and
function mytest ($par1)
what does the & actually do before the $ sign?
It is the syntax for pass by reference. Read the PHP manual on References Explained for more details.
ok thanks a lot 🙂
You're welcome 🙂 Remember to mark this thread as resolved (if it is) using the thread tools.
So the actual need of 2 or more variables to point to the same content is if for exaple you use different variables in a variety of functions that need to have the value?
... that need to modify the same value. If there is no need to modify the value that all these variables point to, there is no need to use pass by reference as pass by value will do.
ok got it now.
thanks 🙂