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

SAP Logon Failed
I tried to login to SAP through MMC.

When i click start and give password.

it

Oracle Connectivity
Hi Every One,

Can we access SAP from oracle database.If it possible then please spec

Lining up columns nicely.
Hello everyone, I'm having problems with making columns line up properly. Here is my code:

Sendmail.php - heading error following check_input
Hi,

I would greatly appreciate some help? I am brand new to PHP and have been searching and e

When file included, REMOTE_ADDR is server's?
I have an index file that handles my site, basically index.php?page=ip will activate "require('

Web Application Recipe
Hi Guys!

I am working with the Web Application recipes. I am currently working on the sen

echo $rows help
Hi all,

Hopefully something simple that I don't know!

I have this:

Code: [Selec

upload only text files
hi guys i want to upload only text like like (pdf,note pad and ofiice files) so can any one please t

Making multiple rows with one query
I have a table called efed_handler_characters with two fields handler_id and bio_id. What query 2 is

Strange php code found on my website
I got hacked and the following code was placed within my files:

Code: [Select]<?
/*

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