[dev] Pass by reference question

Chuck Hagenbuch chuck at horde.org
Tue Jan 11 03:20:41 UTC 2011


Quoting Luis Felipe Marzagao/Andamentos <lfbm.andamentos at gmail.com>:

> Hello:
>
> I'm trying to learn PHP and also the "horde development style", in  
> order to build a module for my company.
>
> Well, maybe this is more of a [beginner] PHP question... anyway,  
> hope anyone can help.
>
> Why in the code below the parameters $vars and $tasklist are passed  
> by reference (line31)?
>
> https://github.com/horde/horde/blob/master/nag/lib/Forms/DeleteTaskList.php
>
> I don't see any of these two variables being changed inside the  
> method, so is there other reason why they should be passed by  
> referece? Is it a performance/memory saving issue?

That's old (PHP 4) style for Horde form. The variables should not, in  
fact, be passed by reference.

-chuck


More information about the dev mailing list