Re: [suspicious - maybe spam] Static Keyword

From: Date: Thu, 30 Dec 2004 21:52:06 +0000
Subject: Re: [suspicious - maybe spam] Static Keyword
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-205390@lists.php.net to get a copy of this message
Paul Higgins wrote:
Hi, I was reading this article: http://www.phppatterns.com/index.php/article/articleview/6/1/1/ . I have a question about it. If you create this static Singleton object, does it persist in memory globally? Or is it recreated each time a .php page is requested?
AFAIK singletons are used so that you only have one object of that type *for a request*. The singleton is created and destroyed on every request (as are all objects). -- Teach a person to fish... Ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html PHP Manual: http://php.net/manual/ php-general archives: http://marc.theaimsgroup.com/?l=php-general&w=2

« previous php.general (#205390) next »