[pLog-svn] PHP - Return by reference?

Oscar Renalias oscar at renalias.net
Fri Jan 26 04:43:48 EST 2007


We're not using those return-by-reference because of performance  
reasons but because of design reasons.

We are just applying the Singleton pattern to make sure that there is  
only one instance of the class used in the code. We want to make sure  
that there is only one Config class, one Db class or one  
PluginManager class instead of having multiple instances of them

On 26 Jan 2007, at 11:27, howard chen wrote:

>> From the LT codes, I found a lot of return by reference,
>
> e.g. function &getDb(),
>
>
> but from the PHP site, it said:
>
> Do not use return-by-reference to increase performance, the engine is
> smart enough to optimize this on its own. Only return references when
> you have a valid technical reason to do it!
>
>
> So why you use return by reference?
>
> thanks.
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn
>



More information about the pLog-svn mailing list