Are Parent constructors called implicitly inside a class constructor?

  • Yes
  • No
  • Depends on the scenario
  • Only in abstract classes
Parent constructors are not called implicitly inside a class constructor in PHP. You need to explicitly call the parent constructor using parent::__construct(). Learn more: http://php.net/manual/en/language.oop5.decon.php
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *