What is an abstract class in the context of PHP OOP?

  • A class that cannot be instantiated directly
  • A class that can be instantiated directly
  • A class that can only have static methods
  • A class that can only have public properties
In PHP OOP, an abstract class is a class that cannot be instantiated directly. It serves as a blueprint for other classes and provides common functionality and structure that can be inherited by its child classes. An abstract class can have abstract methods, which are declared but not implemented in the abstract class itself. Child classes that inherit from the abstract class must implement the abstract methods. For more details, visit: 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 *