How do you define an abstract class in PHP?

  • abstract class ClassName
  • class ClassName
  • interface ClassName
  • final class ClassName
To define an abstract class in PHP, you use the abstract keyword followed by the class keyword and the name of the class. For example: abstract class ClassName. This indicates that the class is intended to be an abstract class. Abstract classes can have abstract methods as well as non-abstract methods. Remember that abstract methods are declared but not implemented in the abstract class itself and must be implemented in the child classes that inherit from the abstract class. To learn more, see: 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 *