Created
October 17, 2022 04:15
-
-
Save abdullah-ctl/654f5bb55e5296f94bd0dfaf153e3f72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Traits : | |
Traits is kind of virtual path, in php we can't support multiple inheritance. So here comes the solution we can use multiple traits in a single class. | |
Interface : | |
Interface like a contact where we can declar properties & method And we can implement that on other class. | |
Abstract : | |
Sometimes we may come across a situation where we cannot provide implementation to all the methods in a class. We want to leave the implementation to a class that extends it. | |
An abstract class cannot be instantiated. It provides an interface for other classes to extend. Abstract method doesn’t have an implementation. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment