Ваші коментарі

TDD

I second this idea.

I believe that people more experienced than me are right in this regard. But I also want to point out that we must live in a practical world and let go of some things to make our lives easier. If you are writing a small PHP website and want to manage DB connection in your application, it is better to use Singleton than writing two classes. It decreases the complexity in the small-scope application but increases it in larger applications. Really most of the choices you make are today vs. tomorrow in this. Singletons are at least better than Global variables in that regard.