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

array_count_values question?
ok i'm trying to create a top ten list from a database of listed favorite movies.

the followi

Php - mysql select?
hi, i have this code:

Code: <?php
session_start();
// dBase file
include &quo

Two fgetcsv related questions ;D
First of im trying to get a file from a merchants server but the directory is protected, I know the

PHP - HTML
Could anyone give me some GOOD sample links for php - html email tutorial.

Thanks!

Quick Question about echo value
Hey guys, I'm trying to get something to show differently in one of my scripts. I'm trying to make

Change Age automatically
hi guys . im new to php , is it possible to change age value in mysql automatically when year change

Warning: session_start() headers already sent error - Driving me Nuts!
I am trying my sister in laws site and I keep getting an error with my coding. I am more of a design

! = ''
In the following 'IF' statement if v_ompcat = PU for example then Oracle equates that 'IF' statement

session variables not working anymore
hello,
i use sessions to handle authentication within my site. my host has been changing a lot of

if php cookie set, show code...
Hi all.. I need to figure out this little snippet right quick.. seems like it should be easy enough

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