Why use interfaces in PHP (OOP)


Posted on 16th Feb 2014 07:03 pm by admin

I am learning OOP in PHP and its been a pretty good learning experience so far. What I didn't understand at all is interfaces. I understand the implications of multiple inheritance, and interface is used just to solve that. But what's the use?
If we have to define the function in derived class why use interface, why not directly declare and define it inside the derived class?
Did you know?Explore Trending and Topic pages for more stories like this.
Am I missing something or is it really useless?
No comments posted yet

Your Answer:

Login to answer
79 Like 36 Dislike
Previous forums Next forums
Other forums

How to add functionality to a simple php calender?
Hello everyone,

I have just finished creating a simple php calander. Can someone point

parse error
Parse error: syntax error, unexpected '[', expecting ')' in /Users/admin/Sites/phptest/array.php on

storing video files into mysql in php
hi

i have my video files in my folder ,
i have to store the path of the videos into db an

Need help in Generating Combinations
Need help generating all possible combination of names in an array

Lets say i have the follow

Dealing with code in db query
I am dealing with C code and I need to make sure it is encoded some how to ensure its integrity and

Sql and php order list script problems
Hi im having a few problems with trying to get the coding right on a orders list ive done (or trying

JQuery, Masterpage, and Control issue
Hey everyone, I am using JQuery in several sites so I thought it would be best to place the library

Having a problem get the selected item from a drop down menu
I have been looking at this for days now.

I have a drop down menu that get it's values from a

Need a fuction to count entries in a field
Hi
I need a fuction to count how many times a email address is entered in to a field.

I ma

Syntax error
hi im having a little trobble with this script
-------------------------------------------------

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash