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

Problem!
I have another problem, when i run this code i get this error "Parse error: syntax error, unexp

BSP Ext - tableView - Sort - NEWBIE
Hi,
I have been trying to get the sort to work. I have defined the column definitions by fillin

Using Windows message as a Handle
Hi,

I am writing one of my first multithreaded programs.

In one of the thread,

Open/Close Links in Php
Hello, Hoping someone can inform me how I can get PHP to automatically open a set of links in a new

Handling text changed in text box control using Ajax
I need to create a web form with a text box control. When someone types text into the textbox I nee

"SEO" URLs
Hey, I'm wondering how to go about creating and using these types of URLs. I'm presuming it's PHP th

Displaying image pathname instead of image
Hello

Im trying to upload and then display images from a mysql database - Its only basic and

How to display value in drop down list after form has been reloaded
Please bear with me as I am very new to php and html.

I have a form with several drop down me

string to currency format
Hi guys...

Actually I chunk out some data from txtfile and one of the data contains amount va

temporary objects
Until now i thought every temporary object in C++ is created as constant. I'm wondering why my compi

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