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

help countdown timers
hello every one,

I'd like to know how to insert many countdowns in the same page.
The dura

SESSION CHECK WORKS "MOST" of the time... whats going on?
i have a sign in check thats included in every page that is a members only page which is basically a

Display last record first.
I need some help how put the last record first and first record last.

Thanks

Code: &am

Cant display mysql data
Hey all,

I am learning php and my first goal is to create a simple CMS. At the moment I am st

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

PHP error (line 38) my website
Hello everyone, I'm new on this
and I got a web site thats got a error not showing the photos on<

Slashes
Have a small problem and I'm not able to understand why I'm getting the results I'm getting... and i

. and .. appearing instead of pictures
First of all, thanks very much for providing this forum. It is very much appreciated!

My son

Guixt issue
Hello all,

We are experiencing the following problem with Guixt:

Some transact

Syntax Help
I'm trying to make a form that edits a php file which contains config settings. I'm using strings t

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