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

Multiple submit forms inside a mysql array page
Hi all,

Im having trouble to get the beneath script to work the thing i can't seem to get wor

Creating Images from images in PHP
Okay well I am trying to make a 'dynamic' calender image with PHP.

I have images like this:

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

Need help with cin setw
I made a program here is my code:

#include
#include
#i

New Login Script
Hi all, i attempted to create a whole new login script witch isnt working for some reason i dont kno

need Array help
This is what I have to do.
$teamname[1] = "Red Sox"
$teamname[2] = "Gian

ok i need to join all this pages to make 1 neat code
i have 5 pages that make up my tv guide it works 100% but i want to make it 1 page if i can or 2, i

Files in current folder. Should be an easy fix.
Never mind. I've asked about this before and just found my answer. Anyway to delete this?

restricting another login once you logout
Hello,

how can I restrict a page from login authenticating against info in a MySQL DB for a s

PHP Redirecting
Hello everyone. Is there a way to redirect people to pages within a statement in PHP? Since there is

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