#30958 [Opn->Fbk]: Wrong instance returned with 2 singletons
| From: | derick@php.net | Date: | Thu, 02 Dec 2004 10:10:42 +0000 |
| Subject: | #30958 [Opn->Fbk]: Wrong instance returned with 2 singletons | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-69718@lists.php.net to get a copy of this message | ||
ID: 30958
Updated by: derick@php.net
Reported By: schaa101 at tech dot nhl dot nl
-Status: Open
+Status: Feedback
Bug Type: Class/Object related
Operating System: Windows XP Pro SP2
PHP Version: 5.0.2
New Comment:
Please post the code here.
Previous Comments:
------------------------------------------------------------------------
[2004-12-02 11:09:30] schaa101 at tech dot nhl dot nl
Description:
------------
When you use 2 singletons, the second singeleton also returns the
instance of the first.
If you change the name of the variables, that store the instance of the
singleton class, inside the singletons and make them both unique, the
problem is solved though.
Reproduce code:
---------------
http://klaas.fiskaaf.com/singleton-bug.rar
or try
http://klaas.fiskaaf.com/singleton-bug.zip
Expected result:
----------------
Singleton1 - Singleton1
Singleton2 - Singleton2
Actual result:
--------------
Singleton1 - Singleton1
Singleton1 - Singleton2
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30958&edit=1