You are here: Re: Three different ways to create a new Smarty object? « PHP Programming Language « IT news, forums, messages
Re: Three different ways to create a new Smarty object?

Posted by Chung Leong on 11/12/29 11:48

kasztelix@gmail.com wrote:
> I belive it is not redundant. Look here:
> http://uk.php.net/manual/en/language.references.whatdo.php
>
> Not using the & operator causes a copy of the object to be made. If you
> use $this in the class it will operate on the current instance of the
> class. The assignment without & will copy the instance (i.e. the
> object) and $this will operate on the copy, which is not always what is
> desired. Usually you want to have a single instance to work with, due
> to performance and memory consumption issues.

PHP uses copy-on-write. Variable separation would only occur if there's
a reference to the object returned.

 

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

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