Best practices for declaring class

It is best you declare your class constructors without requiring parameters. Therefore with default parameters otherwise errors will be generated.

For example if you have user class constructor and you wish to pass some parameters to it, declare constructor like this:

class user
    public function __construct ($email=null, $name=null)

In this declaration all constructor parameters have their defaults and it gives db.php an ability to initialize object of user without passing parameters like this:

new user ();