How do you call a constructor for a parent class?
Hi everyone,
You can call parents class constructors by using parent keyword.
Example :
class parent { function __construct(){ // some code } }
class child extends parent { function __construct() { parent::__construct(); // some code } }
Thanks
Hi everyone,
You can call parents class constructors by using parent keyword.
Example :
class parent { function __construct(){ // some code } }
class child extends parent { function __construct() { parent::__construct(); // some code } }
Thanks
Ads