From: Kevin <ke...@dr...> - 2006-05-11 22:26:10
|
Evan Roth wrote: > Hey Kev (especially), > > I've been overwhelmed at work this week, so have had no time (but we > were featured on boingboing today with our car towers!). > > in any case, i've been browsing through all your updates. is there a > reason that we are passing almost everything by reference? i remember > reading somewhere that =& is deprecated in php5 and causes some sort > of undesired side effect...but not sure of the details. It's what I'm used to with php4. To pass by reference on a return value you have to declare it on both sides of the function/method call. I probably have gone overboard on using pass by reference. I'm used to other languages that do it exclusively by default. (java & python) In some cases I really want a reference passed around to keep the values inside the object consistent. In other cases I do it to avoid the (potentially costly) copy of an object, or collection of objects. I know, I know, that is premature optimization which is a no-no. I started using a logging function that gives very verbose output. I can now see all the places I've used either incorrect or deprecated reference passing. I'll try to clean it up. -Kevin |