Difference between Abstract classes and Interface in PHP

Posted by  Jonas Stuart
PHP
 1226  View(s)
Ratings:
Rate this:
Hi Experts

Please tell me what is a difference between Abstract classes and Interface in php i'm little bit confused between them.

Thanks
  1. Re: Difference between Abstract classes and Interface in PHP

    Abstract classes

    Classes which cannot be instantiated and require subclasses to provide implementation for the abstract methods or in other words you cannot create object of abstract classes and these classes are used for inheritance purpose. Abstract classes can only inherited in your child class.

    Interface 

    similar to abstract class. As we all know PHP does not support multiple inheritance. This problem is solved by interface in which you group classes that share some functionality that do not necessarily share a parent class.


      Modified On Apr-11-2018 04:36:59 AM

Answer