Circular Reference
Intro I just recently ran into something that had me stumbled for quite a while before it smacked me in the face like a ton of bricks. It'd be better to explain with examples, so excuse me if you're reading this and you're surprised to see some gobblygok and you're just looking for techno-gobblygok to look at, okay? For those of you familiar with software languages such as C/C++, Java, and Basic, you may be familiar with this concept of passing variables by reference and by value. For those of you that don't know, this will be good exposure, and an awesome lesson to learn at an early stage to prevent hours of FaceDesking . :P What's a Reference? In many languages, you pass by reference by using the ampersand (&) operator. Like so: function myAdd(&$var, $amount = 0){ $var += $amount; } $toAdd = 5; $amount = 3; var_dump(myAdd($toAdd, $amount)); Normally when you pass a variable in a function, you are passing the value of that va...