One of the more confusing things in PHP right now is references. I'm sure I just confused lots of you with that statement right there, too - and this article from DevArticles hopes to clear it all up.
What are references? Well - References in PHP are simpler than the related mechanism found in C and C++. C and C++ use pointers, which allows for pointing to memory areas. By using references, you can refer or point to the same data using different variables. This is useful when you want to avoid costly memory operations or want functions to access your data directly rather than by copying it.
This is quite useful for when you want to pass an object or a variable that you want to change (or change attributes on) and don't want a copy of it, but want the actual value/object. The article shows you all kinds of examples to when and where you can use these handy little additions to PHP, and even a little "when should" and "when shouldn't" they be used section at the end.




