An example singleton classes in php:
Creating the Singleton design pattern in PHP5 : Ans 1 :
Creating the Singleton design pattern in PHP5 : Ans 2 :
Singleton is considered "bad practice".
Mainly because of this: How is testing the registry pattern or singleton hard in PHP?
Wanna read more? :
A Singleton decision diagram (source):