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

fopen() security
As i understood the usage of fopen() for it to function correctly the Dir you write to has to be rw

start new row of pictures
on my site www.budstreasureauctions.com there is a featured auctions box that users will pay to get

PHP Code / Script To check weather the given email exists in a domain
Hi,

I want to implement the following in my web page

in sign up we will ask to enter u

Run function every 5 mins ??
I have a function PostMessage()

How can I run it every 5 mins ??

Developing Ajax-enabled ASP.Net applications for the iPhone
I would like to develop Ajax web applications using Visual Studio that are optimized for the iPhone.

sql problems
I am having a small problem with my sql statement. it is inserting into 4 of the fields.

fie

extract a file from zip file
hi,
i know how to unzip a zip file in php, but is there a way to just extract a certain file only

Sending a hyperlink through mail
HI all,
I am sending a mail to outlook mailbox of a user using FM SO_NEW_DOCUMENT_ATT_S

How to show next and prev records
Hi all,

Sorry if this is simple, i'm very new to php, well, any programming language actually

Creating a function
Basically i wanna put all this code in a seperate file

Code: <?php

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