PHP Architect · Vol 18, Issue 9 · September 2019
Pragmatic PHP: Studying Singletons
by Edward Barnard
Practice makes perfect, except when writing PHP code! Our new column Pragmatic PHP explains patterns and variations I’ve used over the years. The better we understand a pattern, the better we can successfully solve the problem before us. This month we’ll take a deep dive into the Singleton Design Pattern. Even though it’s generally considered an anti-pattern, we’ll see useful variations I use time and again. Can global state, static methods, and properties be unit tested? Certainly. We’ll see how.
The full article is in PHP Architect Vol 18, Issue 9. Subscribe to read it and every new issue.