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 empty
Hiya peeps,

Ok here is the codes.

order.php

Code:

Remore client postprocessing phase getting dump SAPSQL_ARRAY_INSERT_DUPREC
Hello Expects,I have started remore client copy. Data was copied successfully. but while running pos

Extending Exception to contain method name
I was wondering, if there's a way to extend Exception in such a way, that it would contain name of a

Open link with largest int string first
I have the following links i would like to open either all at once or one-by-one. How would i procee

Search with relational database
Hey,

I have quite a complicated (for me anyway ) relational database for an apartments syste

What am I missing here? Help!
Hello all!. I can't seem to get this working right. Well - it renders right, but something is goin

EU VAT Package 2010
Does any one know whether SAP will be developing new reporting functionality due the new VAT rules t

Why is this function returning a false value when it shouldn't be??
This is in an include file. I want it to check a value in an html form and see if it's just white s

user administration
Dear @all,

what I have to do to set the user defaults for new users. At the moment I woul

php include email form with attachment
I have had no luck with finding a email form all over the Internet for various reasons. Some insecur

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