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

Bit manipulation program with binary operations
My homework is to create a program to scan in and add binary numbers and print them like so

Mouseover to edit (Ajax)
hi friends, can anyone help with the code behind to get this application working, please in VB (new

JSON SORT WITH PHP
I have two products that I want to sort by say "Id:17, value: xxx" using php
The page w

Trouble verifying database password
Thankyou to everyone who responded to my last post (I can't find the posting, it has been buried). <

http to https
Hi,

Is there any specific method/condition to move an http:// page to https:// ?

cyrillic string conversion question
Hello,

First time here...

I would like to know if there is a way to convert a

PHP & Java
Hello,

can PHP code be used inside java code?

Code: <SCRIPT LANGUAGE="Java

Posting to another Site?
I have software that people install.
When they install it, is there a way to make it post their d

duplicate record notification
In my database, after insertion of records, I want to know if the record inserted is duplicate or no

Final year project, please point me in the right direction
hi there for my final year project I'm aiming to build a php script shell to use as an expert system

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