Reply to Re: PHP Singleton Function

Your name:

Reply:


Posted by howachen on 05/14/06 21:10

how about PHP4? need explictly use reference?



Ryan Lange wrote:
> howachen@gmail.com wrote:
> > if this instance use a lot of memory, would it be better if i use
> > reference?
> >
> > e.g.
> >
> > //*********************
> > public static function &singleton()
> > {
> > if (!isset(self::$instance)) {
> > $c = __CLASS__;
> > self::$instance = new $c;
> > }
> >
> > return self::$instance;
> > }
> > //*********************
>
> By default, objects in PHP5 are passed/returned by reference, so
> this is unnecessary.
>
> Ryan

[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

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