note 62575 added to language.oop5.patterns
| From: | o dot claudio at gmail dot com | Date: | Fri, 03 Mar 2006 17:59:27 +0000 |
| Subject: | note 62575 added to language.oop5.patterns | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-104783@lists.php.net to get a copy of this message | ||
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?
----
Server IP: 66.163.161.117
Probable Submitter: 200.199.23.121 (proxied: 172.27.139.229, 172.27.139.1)
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/language.oop5.patterns.php
Edit -- http://master.php.net/note/edit/62575
Del: integrated -- http://master.php.net/note/delete/62575/integrated
Del: useless -- http://master.php.net/note/delete/62575/useless
Del: bad code -- http://master.php.net/note/delete/62575/bad+code
Del: spam -- http://master.php.net/note/delete/62575/spam
Del: non-english -- http://master.php.net/note/delete/62575/non-english
Del: in docs -- http://master.php.net/note/delete/62575/in+docs
Del: other reasons-- http://master.php.net/note/delete/62575
Reject -- http://master.php.net/note/reject/62575
Search -- http://master.php.net/manage/user-notes.php