Hi,
I do not understand when to use references and when to not use references. I have looked at a ton of information on the web, and I just don't understand it...
I use references when passing arrays... but other than that, I do not understand when to use them.
Thank you.
references
Moderator: General Moderators
it is usefull i you have "large" datastructures that need to be passed around... because otherwise you need to copy them... certainly with recursive functions thiis can become a major partystopper 
and then with php4, if you have a function that manipulates an object (passed via a parameter), you will be surprised that a copy was manipulated... so in that case it is also required to use a reference (instead of a copy by value)
and then with php4, if you have a function that manipulates an object (passed via a parameter), you will be surprised that a copy was manipulated... so in that case it is also required to use a reference (instead of a copy by value)
-
The Monkey
- Forum Contributor
- Posts: 168
- Joined: Tue Mar 09, 2004 9:05 am
- Location: Arkansas, USA
This article on references is very useful.