1. What is an abstract class in PHP? Give an example.
An abstract class cannot be instantiated directly. It can contain abstract methods that must be defined by child classes. Abstract classes are useful when creating a base class for related objects. Example: abstract class Animal { abstract function sound(); } class Dog extends Animal { function sound(){ echo 'Bark'; } }
abstract class Shape { abstract function area(); }