Reputation:
PHP -If we create object of child class in php, does it call parent class constructor and then clild class constructor like java?
Upvotes: 2
Views: 91
Reputation: 160883
No, you need to call the parent constructor in child class.
public function __construct() {
parent::__construct();
//...other code
}
Upvotes: 1