Home > DeveloperSection > Forums > Difference between Abstract classes and Interface in PHP
Jonas Stuart
Jonas Stuart

Total Post:10

Points:70
Posted on    June-26-2016 10:43 PM

 PHP PHP  Abstract Class 
Ratings:


 1 Reply(s)
 240  View(s)
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


Mark Devid
Mark Devid

Total Post:101

Points:707
Posted on    June-26-2016 10:48 PM

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 Jun-26-2016 10:51:59 PM

Don't want to miss updates? Please click the below button!

Follow MindStick