[dev] reference assignments

Jan Schneider jan at horde.org
Thu Feb 23 23:36:21 PST 2006


Zitat von Chuck Hagenbuch <chuck at horde.org>:

> Quoting Michael M Slusarz <slusarz at mail.curecanti.org>:
>
>> Noticed on some of the commits that you have flip-flopped on the
>> reference assignment syntax.  According to docs/CODING_STANDARDS:
>>
>> If assigning a reference to a variable, place the ampersand next to the
>> referenced object, not the equal sign::
>>
>>    $reference = &$foo;
>>    $reference = &foo();
>>
>> Have we changed that now?
>
> Well, I've changed my thinking on it. I had forgotten that was
> explicitly mentioned in the coding standards; I've just taken it out
> since it's not something I think is "wrong" either way. I used to feel
> like the & was modifying the variable or function, not the assignment;
> now I feel like it's a bit clearer to read it as having the & modify
> the assignment, not the variable or function. If that makes sense.

That's true, but I would like to stick to the old coding standard. We  
use it all over the place, inconsistency is bad, and changing all  
assignments now is simply mad. We drop them all in Horde 4 anyway.

Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/


More information about the dev mailing list