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

urldecode question
How would I format this line of code properly?

<?php echo urldecode($_GET['Title']); ?

True way to see if action was successful?
If this is a good way to see if action was successful to continue:

Code: function changeGa

Insert numbers from Barcode scanner into online php page
I have a real big problem, Here is what I'm trying to do. I have a Intermec CN3 handheld computer th

whats wrong with my code please help!!!
this is the error


Warning: mysql_close(): supplied argument is not a valid MySQL-Link res

Beginners syntax and loop questions - help please!
Hi everyone,

I have some problems with php code. I'm currently in the middle of learning php,

default SAP userid
hi,, I just like to know if it is ok to use the default SAP user id (SAP*)?

Select question
Hi,

First I would like to say that php is pretty new for me..
so please don't shoot me if

need help about
i store the value of my select statement result to an array and stored it to a variable named $fname

Internal Server Error issues
This has been bothering me for weeks and I've been trying to solve it without asking for help, but e

Displaying data from MySql a different way
Hi all,
I'm pretty new to php and MySql and have hit a problem.

I am able to display data

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