title: Singleton or Dependency Injection pattern for database connection
body: <p><em>Normally, a good googling session would suffice to answer most of my questions, but <code>$this</code> isn't one of them. Thus, it's is my first question here :</em> </p>
  
  <p>A lot of people (at SO and elsewhere) say that Singletton is bad. Actually so bad that some fellow developers even consider it as an <strike>Anti-Christ</strike> Anti-Pattern and should be replaced by Dependency Injection Pattern. The only exception to this 'rule' is with loggers (well, <a href="https://stackoverflow.com/questions/2662842/dependency-injection-singleton-design-pattern">almost</a>). </p>
  
  <p><a href="https://stackoverflow.com/a/4596323/2372954">Some argue</a> that because in PHP variables are at most 1 request-old ...</p>
  
  <blockquote>
    <p>[...] one of the two main purposes of a Singleton is not applicable here.</p>
  </blockquote>
  
  <p>But during that one request, multiple fetches from the Database may/will occur. Database is a shared resource between ALL the requests and if I don't make sure that there's as few connections as possible, I may get struck with a <code>max_connections</code> error (just an example). </p>
  
  <p>So, if Singleton is a bad design in most cases, what about managing Database connections ? Is Singleton a good idea or I should opt for DI ? </p>
  
  <p>Thanks in advance : )</p>