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

Request-URI Too Large
I have created a simple submit form for a mysql database that puts a piece of code into database.<

foreach help.
Hello all,

First time I'm attempting to use a foreach statement and was just wondering if my

Generate multilayered array from string.
ok so i have a string that looks like this:
Code: blog:edit_all,delete_all|users:edit_all,delete_

How to display objects in a row
I have 7 codes that i want to display in a row one next to another.
The first is {$ads->ad

License Issue - service type user
Hi,

I would like to understand the following issue regarding sap license.
I wish to

session variables not working anymore
hello,
i use sessions to handle authentication within my site. my host has been changing a lot of

getting weird error..
okay, I'm getting an error on this particular function, something about the syntax in the mysql LIMI

Upload file!
Ok i have a form..
Code: <form name="form1" method="post" action=&quo

PHP webpage & array print issue
I have this code running, and it works perfectly … however, see my bottom bit about what I see

login page does not execute a else statement
I've created a login page using sessions.
When an incorrect user name or password is entered then

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