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

Passing an array of values From VB6.0 to Oracle PL/SQL Function
Basically we are using VB6.0.

When we try to pass an array from VB6.0 to an Oracle PL/SQL

Return X values where an ID number doesnt matter
Well as for subject heading, thats the best i could think of.

Currently im having a problem w

mr8m - reverse document
Friends,

I'm trying to reverse a document held by MIRO, but it reports the message balan

What makes a script your own?
If someone finds a login script online, and changes some variable names around and some other minor

Is there something wrong?
Hi all,

Just a quick question... can someone look at this code and see if something is wrong?

if else problem, help please
i have this script that i made only i try to also put in a if else for for some reason the script is

help removing unwanted graphic
How do I remove the small elongated rectangular shape between the "Latest post" and "

Help adding strtolower( to my in_array
strtolower i need to add it to this to work, iuno how.

Code: $moderators = array('Admin', 'ba

Apple's revamped lineup arrives

I'm personally curious about the magic mouse.. a multi-touch concept sounds like it could be nea

Is there a way to override built in php functions without APD?
I am trying to use the
rename_function()
override_function()
options that are built into

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