You are here: Re: Returning References « PHP Programming Language « IT news, forums, messages
Re: Returning References

Posted by alo.and on 01/01/07 16:12

> according to the php manual, it said:
>
> Do not use return-by-reference to increase performance, the engine is
> smart enough to optimize this on its own.
>
> I doubt if this only apply to the PHP5 engine, while if I am using
> PHP4, performance is a factor to continue to use return by refercnece?

No, return by reference will not increase performance even in PHP4,
unless you're using a really huge variable with MBs of data, that is
not the common case.

Using references without a technical reason to do that (when you really
need a reference to be returned) wil only cause unecessary annoyances
to the coders.

Remember to mantain your code as simple as possible while this practice
will not cause any perceptible performance or other issues.

Also, its important to say that normally the principal bottleneck in a
common PHP application is the Database, that eventually need a fine
tuning. PHP performance is easily solved using an opcode cache
soluction, like APC, that mantain your scripts compiled in memory,
elimitating the compile time when each access is requested to the
webserver.

Best regards,
Alonso

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация