PHP Architect · Vol 18, Issue 8 · August 2019
Internal Apparatus: Generated Singletons
by Edward Barnard
This month we study the Singleton Design Pattern, but with a twist. We start with a correct implementation but get it wrong by refactoring. We’ll examine the PHP generated code, each step of the way, to understand what went wrong. We’ll observe at least two reasons the Singleton Design Pattern is now considered an anti-pattern. We’re preparing to learn useful variations next month by seeing precisely how it works under the hood.
The full article is in PHP Architect Vol 18, Issue 8. Subscribe to read it and every new issue.