The Singleton pattern is generally the first Design Pattern a developer is exposed to, because it solves a common problem and it is easy to understand and implement. Even though Design Patterns are language independent, each language often implements them differently. It is also important to remember that the context of the application can cause the implementation to change as well. Design Patterns are patterns not rules.
PHP allows you to create the Singleton in such a way that the internal code of the class can be agnostic. Changing the package or class name does not affect the Singleton implementation itself. (more…)