Singletons in PHP



I was reading an article on TalkPHP (http://www.talkphp.com/
showthread.php?t=1304) about singletons but I'm afraid I don't
understand why I need to use them. I understand how to code them
perfectly, it's just the theory I'm having some problems with. I did
try searching on Wikipedia but it didn't yield any satisfactory
reasoning, for me.

Could someone explain it to me in basic terms, please. I initially
came across singletons when I was looking for ways in which to save on
the extra memory of instantiating many of the same objects, and if I
am right, a singleton would do just that? I'm just not sure how as it
looks fairly straightforward in its implementation.

Thanks in advance.
.



Relevant Pages

  • Singletons in PHP
    ... I was reading an article on TalkPHP (http://www.talkphp.com/ ... showthread.php?t=1304) about singletons but I'm afraid I don't ... came across singletons when I was looking for ways in which to save on ...
    (comp.lang.php)
  • Re: Singletons in PHP
    ... showthread.php?t=1304) about singletons but I'm afraid I don't ... Singletons are (or ... unit testing, they can be a real pain in, you know where. ... the extra memory of instantiating many of the same objects, ...
    (comp.lang.php)