Can an instance of an abstract class be created in PHP?

  • Yes
  • No
  • nan
  • nan
No, an instance of an abstract class cannot be created in PHP. An abstract class cannot be instantiated directly because it is incomplete and serves as a blueprint for other classes. Abstract classes can only be inherited by child classes, which must provide implementations for the abstract methods. Attempting to create an instance of an abstract class will result in a runtime error. To utilize the functionality of an abstract class, you need to create an instance of a concrete child class that extends the abstract class. To know more, refer to: http://php.net/manual/en/language.oop5.abstract.php
Add your answer
Loading...

Leave a comment

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