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?
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

Auto-populating dropdowns and multiple forms.
Here's what I have so far:

First drop down = select a state (works)
This populates the sec

problem with sql querry in php script
Hello guys,

What I want to do is I want to read out a csv file and then but te conent ot the

CRM?
I think that's what they're called. Customer Management System? Anyway. Is there any good free ones

quick question about System Change Number(SCN) in FlashBack Query topic
i know tht we can get the SCN of the database using flashback concept as follows

SQL>

a multi dimensional array with for each
hi, I have been asked to write an array, I have Zone 2,3,4,5,6,7,8 each zone has 3 sections of weigh

how to query data from website using VC?
I want to query some datum from a website,so I need a program to read data from a .csv file, and ass

article site help remaining text
Hi all hope you will be fine
I am creating a article site in this site i want to put some text on

SQL query not working well
Hi,
I made a small table with 5 rows and want to make them an sql consult using rownum

Bandwidth monitoring?
Hi guys,

I need a little information I have written a php app and I occurred to that I need

Why does this file not return file names that start with numbers?
This file returns a list of filenames to help populate a drop down in my form. For some reason it ig

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