singleton in php?
[email protected] (":B nerdy") Wed, 4 Sep 2002 21:37:25 +1000
| Newsgroups | php.lang |
|---|---|
| Message-ID | <[email protected]> |
i want it so i only ever have one object of this class ever in my program. all new instances of the object will simple be references to the first object. how can i implement this? i can do it in java by making the constructor private and then having a static method to return a static variable init to an object of the class if it is not init yet. how can i have a singleton object in php? ASAP via email as well. cheers