According to the first embodiment:
1. Why do we need a Database class?
2. You will have only one class in the entire application? or more? And how will new connections after new myclass and myclass2?
For the second one.
Highbrow don't like singleton. Something in the testing prevents. Plus religious intolerance. So use the static singleton
only if you have code organized in a classic procedurecolumnout.
If you're a kosher class hierarchy, as seen in another answer, pass
the connection into the class, not create it every time again.
$this->db = $db;