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

Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there

Date/Time and Checkbox
Hi Everyone,

I am trying to figure out how to insert the current date and tim

PHP code for a proxy
I was wondering which function I could use to create an online proxy tool. I was thinking cURL would

Tournament Brackets (Double Elimination)?
Is making a double elimination tournament style bracket system capable of being done in php?

PHP Error
On my .php page I have a drop down box that has several names in it. When a user clicks the name &am

Passing PHP variables from one page to another
Hello-

I'm having trouble figuring out how to transport a variable from one php file to anoth

how to easy edit text, with box? Help.
Hi.
I have a little problem. I'm doing a webpage for my aunt and I would like to make it as easy

How to create a static html menu from a database
Hi,

I have built a small cms which allows me to create simple html pages and then upload them

Filename like the user name
I am creating a form and storing the values in file. Could anyone please tell me how to write a code

Pop-up Banner
Hello Friends,I need to use banner in our client site.Example: www.example.com if i enter this site

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