Reply to Re: global or $GLOBALS

Your name:

Reply:


Posted by Thomas Mlynarczyk on 05/18/06 21:48

Also sprach Erwin Moller:

> Passing by reference is faster, because normal passing involves a
> complete copy of the variable.

No. See http://www.zend.com/zend/art/ref-count.php

Quote: "Note that PHP 4 is not like C: passing variables by reference is not
necessarily faster than passing them by value. Indeed, in PHP 4 it is
usually better to pass a variable by value, except if the function changes
the passed value or if a reference ... is being passed."

PHP simply creates another entry in the symbol table pointing to the same
stored value and does not copy it until one of the variables is actually
changed. Thus, references would not necessarily be faster.

Greetings,
Thomas

[Back to original 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

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