Intermediate PHP
Q41 / 100

What is the difference between abstract class and interface in PHP?

Correct! Well done.

Incorrect.

The correct answer is B) Abstract classes can have implemented methods and properties; interfaces only declare method signatures (PHP 8 allows constants)

B

Correct Answer

Abstract classes can have implemented methods and properties; interfaces only declare method signatures (PHP 8 allows constants)

Explanation

Abstract classes can provide partial implementations and state. A class can only extend one abstract class but implement multiple interfaces.

Progress
41/100