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

Place specific image in html page when specific name is typed.
Hello,

Fairly new to PHP and was curious if someone might know how to solve a fairly simple r

PHP - HTML
Could anyone give me some GOOD sample links for php - html email tutorial.

Thanks!

Relative path
I have a absolute path to an image - like so: C:/Program Files/Apache Software Foundation/Apache2.2/

How to ... (FAQs)
... get e-mail notifications As several people asked how to get e-mail notifications when new posti

Linkage between two scripts
Okay say I have this for a link in a script:

Code: <li><a href="#&q

data type in column definition
Hi,
I create a table with column called "Direction of Travel code ".
The travel codes in t

Significance of BPM
Hi Experts,
I am a novice in BPM , I just want to know how BPM as permenant department is

New Login Script
Hi all, i attempted to create a whole new login script witch isnt working for some reason i dont kno

passing data from one page to another
hey guys
i have the follwoing code to get information from one page and place on another:

Exporting new records
Trying to figure out the best way to set this up.

People register my site.

Their prof

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