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

Simple Scraper... Weird Output
Okay, maybe I just need a Blue Monster and some sleep, but....

I'm scraping a ringtone site

Do While statement
hi guys,

This may sound trivial but im new to php and as part of an assignmenti have to const

why does my session end?
my connect.php starts the session just so you know
i can navigate arround my site fine except whe

Calender Not Opening
The following code is not loading the javascript calender in another window. It's not doing anything

does anyone know a php script to send mail using gmails/googles free smtp server
cause i heard u can do that but i dont know how

Setting condidtions for an input box
Hi all,

I would like to set a condition in a txt box that says the number a user enters has t

Need help with cin setw
I made a program here is my code:

#include
#include
#i

need help with date function
i have following form for date

Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01

Typing math
I've added support for typesetting math using LaTeX on the forums.

Example:
Code: [Select]

Header is not working in IE
Hi ! header function is not working in IE but it works in FF, Safari, Chrome. any help please. :

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