note 88443 added to language.oop5.patterns
| From: | lokher at gmail dot com | Date: | Sat, 24 Jan 2009 15:52:37 +0000 |
| Subject: | note 88443 added to language.oop5.patterns | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-149727@lists.php.net to get a copy of this message | ||
22-Jan-2009 09:34 vaddsm(at)gmail.com:
Nice code vaddsm but the whole point with a singleton class is that it is only possible to
intanciate the class once and only once.
For instance the following example will create multiple instances of fClassTwo:
<?php
$MySingleton = new fSingleton();
$MySingleton->fClassTwo->get();
$YourSingleton = new fSingleton();
$YourSingleton->fClassTwo->get();
$instance_3 = new fClassTwo();
$instance_4 = new fClassTwo();
$instance_5 = clone $instance_3;
?>
----
Server IP: 62.73.196.231
Probable Submitter: 88.88.81.125
----
Manual Page -- http://www.php.net/manual/en/language.oop5.patterns.php
Edit -- https://master.php.net/note/edit/88443
Del: integrated -- https://master.php.net/note/delete/88443/integrated
Del: useless -- https://master.php.net/note/delete/88443/useless
Del: bad code -- https://master.php.net/note/delete/88443/bad+code
Del: spam -- https://master.php.net/note/delete/88443/spam
Del: non-english -- https://master.php.net/note/delete/88443/non-english
Del: in docs -- https://master.php.net/note/delete/88443/in+docs
Del: other reasons-- https://master.php.net/note/delete/88443
Reject -- https://master.php.net/note/reject/88443
Search -- https://master.php.net/manage/user-notes.php