In actual fact, this here is implemented incorrectly, as nowhere should be instantiating an instance of PdoDatabase except within the gGetDb function - which I'm actually tempted to make a static method on the PdoDatabase class, and change that constructor to be protected.