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
Loading...
Related Quiz
- Which of the following statements about variable scope in PHP are correct?
- What is the static variable in a function useful for?
- The foreach loop in PHP is used exclusively for arrays.
- You have a while loop in your PHP script that is not terminating as expected. What could be the possible reasons and how would you debug this?
- What are some commonly used network functions available in PHP?