note 62575 rejected from language.oop5.patterns by betz
| From: | betz@php.net | Date: | Sat, 04 Mar 2006 01:21:06 +0000 |
| Subject: | note 62575 rejected from language.oop5.patterns by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-104807@lists.php.net to get a copy of this message | ||
Note Submitter: o dot claudio at gmail dot com
----
I don't get the point of using the Singleton pattern in PHP.
I have created and ran these example (class Example "Example.php" and the test page
"examplepage.php"). I've commented out the lines that would issue errors (new Example
& clone). When I call and reload examplepage.php in the browser, I *always* get the same
response: "I am constructed Woof!", which means it's *always* creating a new instance
of class Example. I expected that, starting from the second call to the page (reload), the response
would be just "Woof". Am I doing something wrong?