kickeru Posted September 22, 2009 Share Posted September 22, 2009 hi, i am new to php programming, i am learning php from php.net can someone tell me the difference between an interface and an abstract class? it seems that you need to implement functions from either the interface or from the abstract class, they can be defined or you need to define and can redefine them. what advantages would one have over the other? when would you use one and not the other? Link to comment https://forums.phpfreaks.com/topic/175087-interface-vs-abstrac/ Share on other sites More sharing options...
trq Posted September 22, 2009 Share Posted September 22, 2009 An interface simply forces methods that must be implemented within the child. An abstract class however can define implementations of methods (that your child then inherits) as well as force a child to have to implement other methods itself. Link to comment https://forums.phpfreaks.com/topic/175087-interface-vs-abstrac/#findComment-922791 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.