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

Displaying a clickable playername
I am going wrong somewhere with the mysql_query, can someone please put me straight?

$playern

PHP template help
Ok, I don't know if anyone can help me but I am using PHP templates to make a site. I am a newbie an

MySQL issue
I am taking sentences through a form on page. Then checking some condition and trying to insert them

Need help with PHP/MySQL drop down menu
I need help on how I can implement a drop down menu which queries mysql database and output the avai

email form (cannot find the problem)
Hello there. I've been having trouble with an email form. Can't find the problem really. I've tested

rookie looking for help coding a CSS form with PHP
I'm trying to figure out how to add PHP code to my xhtml form so that it is a working form embedded

Get last modified date of web page
Hai All,

In php how can i get last modified date of a give web page . I have tried to g

Place specific image in html page when specific name is typed.
Hello,

Fairly new to PHP and was curious if someone might know how to solve a fairly simple r

Connection Timeout
I'm using xmii 12.0

I'm calling a transaction as a web service from a windows application

parse error
Parse error: syntax error, unexpected '[', expecting ')' in /Users/admin/Sites/phptest/array.php on

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