Renga's weBlog

February 6, 2009

Difference between Abstract class and Interface in PHP


Abstract Class



For abstract class a method must be declared as abstract. Abstract methods doesn’t have any implementation. For interface all the methods by default are abstract methods only. So one cannot declare variables or concrete methods in interfaces.


The Abstract methods can declare with Access modifiers like public, internal, protected. When implementing in subclass these methods must be defined with the same (or a less restricted) visibility. All methods declared in an interface must be public.


Abstract class can contain variables and concrete methods. Interfaces cannot contain variables and concrete methods except constants.


A class can Inherit only one Abstract class and Multiple inheritance is not possible for Abstract class. A class can implement many interfaces and Multiple interface inheritance is possible.


  1. Thank you, Useful information!
    pharmacy price compare

    Comment by Richardcef — November 6, 2017 @ 4:08 AM

  2. I blog frequently and I genuinely thank you for your content.
    This article has truly peaked my interest. I’m going
    to bookmark your website and keep checking for new details about once per week.
    I subscribed to your RSS feed as well.

    Comment by BeerMenus - Support - — October 17, 2017 @ 2:14 PM

  3. this is my comment

    Comment by Aniket — April 6, 2017 @ 5:19 PM

  4. k

    Comment by Anonymous — February 21, 2017 @ 4:24 PM

  5. A fitness center portion of your healthy weight loss and rapid weight loss is straightforward.
    One does about three exercise routines per group of muscles, and do two muscles every day.
    Which means you are capable of doing torso and tricep muscles the initial day,
    back and biceps the 2nd day, and legs and shoulders the
    third day. Complete your workouts away on all those 3 days with fifteen or 30 minutes of cardiovascular exercise.
    About the 4th day time, do only abdomen exercise routines,
    if you do not are operating your ab muscles around the other 72 hours in addition to the other muscles.
    If this is the case, then the fourth day is a complete day of rest.
    In order to be entirely successful within your healthy weight reduction and rapid
    weight loss trip, you should give your body a chance to recuperate.

    The last ingredient is rest, although you are giving your body the nutrients that it needs to recuperate from your healthy
    weight loss and quick weight loss efforts.

    You will ensure success in Phase II of your healthy weight loss and quick weight loss journey, by utilizing these exercise methods and techniques.

    When you have perfected the health club regimens
    in the list above, then you are ready for additional superior instruction approaches.
    You may discover more information about every one of the exercise tuning training approaches for a proper weight-loss and fast weight
    loss system outlined on this page, and also more advanced training
    methods, by hitting my website’s website link beneath.

    You can join my cost-free registration site, and obtain access to all thenutrition and dieting, and exercise details
    which i send out to all of of my associates.
    Additionally, you will be able to construct the exercise program that
    is best for you, and make sure ensuring your success in Stage II of your respective healthy fat
    loss and rapid loss of weight trip these days!

    Comment by weight loss diet — June 9, 2016 @ 12:35 PM

  6. test

    Comment by Anonymous — October 16, 2015 @ 2:01 PM

  7. fgjghjfhjgjg ghjghfjgh

    Comment by Anonymous — June 18, 2015 @ 3:26 PM

  8. Reblogged this on Блог zBujhm-а.

    Comment by zbujhmz — March 12, 2014 @ 6:12 PM

  9. It does appear, however, that hypnosis can help a person achieve his or her weight loss goals.
    It’s old news that tracking food intake could
    lead to losing a few pounds [2]. Then leave it a while until your tummy lets you know that you’re hungry again before opting for a healthy snack.

    Comment by Reynaldo — August 2, 2013 @ 7:50 AM

  10. If you find it a bit maddening to follow the
    daily fluctuations of the scale even though you are eating
    properly, pick three days of the week on which you will always weigh yourself (for example, Monday, Wednesday,
    and Friday). Cucumber contains sterols which can help to lower cholesterol and prevent carbohydrates from converting to body
    fat. Many people don’t have the time to weight themselves every day, but checking the scale on a regular basis can definitely help when you’re working to lose weight and keep it off.

    Comment by Leandra — July 25, 2013 @ 4:50 AM

  11. If you find it a bit maddening to follow the daily fluctuations of the scale even though you
    are eating properly, pick three days of the week on which you will always weigh yourself (for example,
    Monday, Wednesday, and Friday). Vinson had participants keep their
    normal diet and exercise routines (or lack thereof) and merely added the green coffee.
    Do not be tempted to lose weight as quickly as you can, because a crash diet will have you eating less than a thousand calories a day slowing down your metabolism.

    Comment by simply click the following web site — July 18, 2013 @ 10:36 PM

  12. “I will need to have some ability connected with to thank everyone concerning the quality hints We’ve got frequently liked opportunities your webpage. We’re pumped up about the graduation aiming to these kinds of secondary education taking a look at additionally your entirety placement of feet wouldn’t usually are completely finish devoid of on the way onto your website site. Plainly might be of an average assist individuals, I’ll be fortunate to be able to of what We have studied out of this point.”

    Comment by seohosting — June 27, 2013 @ 4:03 PM

  13. Major follows some sports, primarily during the playoffs.
    All that energy is boxed in, amplified by the space.
    Moreover, there you could also play Scrabble in the internet, TV game shows or game consoles.

    Comment by Bob — June 15, 2013 @ 10:45 PM

  14. The internet is fueling the success of music because it can be listened to at any time of the day and anywhere in the world.
    Regular workshops ensure that the staff at PVM Radio subdivision is not only up
    to date with the latest technological innovations, but also ensures
    that the customers from diverse backgrounds are offered the
    best possible services to suit their tastes.
    There are many websites that bring to people radio channels for their personal entertainment.

    Comment by sunrise radio uk — June 15, 2013 @ 8:36 AM

  15. “Worked All Zones Award” is the same concept with time zones.

    Often, long term schedules with a bit of breathing room work
    best. Many people will be happy with replaceable
    batteries for home use and occasional outings.

    Comment by — June 4, 2013 @ 4:35 PM

  16. Even your indoor pool is there at your service. At Ljubljana Airport, Slovenia Paphos Car
    Hire is hardly limited just somewhat expensive. Luckily for people like us could
    be a lucrative business project. Then there are also a number of factors, all
    of that and more. Holidaymakers who have been saving carefully and
    frugally over the years. Payless paphos car hire services the Ft.
    For example, you may not realize is that you know where to take their clothes
    and belongings.

    Comment by car hire paphos airport — May 17, 2013 @ 5:21 PM

  17. No longer does a music lover need to bother about traveling
    out of range when a fantastic song comes on over the vehicle
    radio. Next, build a list of prospects and develop a relationship with those prospects on your list.
    So, a custom direct application and route tracking can make it easier to you
    cut fuel cost, save visit time and wholesome delivery.

    Comment by Latesha — May 17, 2013 @ 9:38 AM

  18. As the medium is not limited to any particular geographical or demographic
    region, advertising on internet radio would give the business an international audience base.

    As business owners recognize the swaying power of using audio to communicate the value and quality of their products and services, online audio will come of age in a
    big way. You can see if any of your Facebook friends are listening by clicking on the Facebook link on the
    bottom right.

    Comment by Charis — May 11, 2013 @ 11:17 PM

  19. Abstract classes do allow constructors to be added but interfaces don’t.See
    Abstract class and interface

    Comment by javaexp — January 2, 2013 @ 7:33 PM

  20. pathetic diff.. anyone can easily get from

    Comment by M — December 6, 2012 @ 5:59 PM

  21. nice

    Comment by roopa — October 12, 2012 @ 10:57 AM

  22. good and understandable differentiation

    Comment by madhuri — September 30, 2012 @ 5:19 PM

  23. In principle, if an abstract class contains only abstract methods we’re using it as an interface.
    Abstract classes are used to share functions.
    The interfaces are used to share how you have to do something.
    Source Interface VS Abstract Class in PHP

    Comment by Al — April 10, 2012 @ 2:31 PM

  24. Very good and useful, keep it up…Thanks…..

    Comment by koushik Chatterjee — March 5, 2012 @ 8:56 AM

  25. […] Difference between abstract classes and interfaces […]

    Pingback by Interface vs. Abstract class en PHP – castellano « Alessio Mavica — September 12, 2011 @ 11:21 PM

  26. […] Difference between abstract classes and interfaces […]

    Pingback by Interface vs. Abstract class in PHP – italiano « Alessio Mavica — September 12, 2011 @ 11:20 PM

  27. Abstract Classes

    1. An abstract class can provide some functionality and leave the rest for derived class
    2. The derived class may or may not override the concrete functions defined in base class
    3. The child class extended from an abstract class should logically be related


    1. An interface cannot contain any functionality. It only contains definitions of the methods
    2. The derived class must provide code for all the methods defined in the interface
    3. Completely different and non-related classes can be logically be grouped together using an interface

    Comment by ehandmadepaper — May 23, 2011 @ 11:04 AM

  28. einnahme generisches flagyl – einnahme generisches flagyl einnahme generisches flagyl nebenwirkung von lasix nephrotisches syndrom – nebenwirkung von lasix nephrotisches syndrom nebenwirkung von lasix nephrotisches syndrom lasix ohne rezept bestellen – lasix ohne rezept bestellen lasix ohne rezept bestellen lasix howto – lasix howto lasix howto

    Comment by PriduralBT — March 10, 2011 @ 6:32 PM

  29. nice

    Comment by haresh — November 2, 2010 @ 5:01 PM

  30. It seems not true that Abstract class can’t have an implementation of a method? An I right… e.g.

    Comment by Luka — October 5, 2010 @ 11:12 PM

  31. Good differentiation 🙂

    Comment by Rajeev — September 14, 2010 @ 4:54 PM

  32. dsfsadf

    Comment by fgdgsd — October 6, 2009 @ 4:37 PM

  33. All methods declared in an interface mustn’t be private or final but it may be public, static etc.

    Comment by sasikant — May 7, 2009 @ 7:18 PM

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: