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

php title problem
Hi,

I am having a problem managing my page title with PHP.

Currently I have my <

PHP Function Page Advice
Hi All, I am quite new to PHP and Javascript but have written an Online Shop (Mainly for Fun and edu

Data storage spaces in varchar2
Trying to understand what's happening.
I am selecting a value from a table that is defined as c

Preserving user-entered linebreaks
Hi, I'm building a web 2.0 thingy from scratch and I wanna display text which users input. It's all

GMail like Chat in ASP.NET
Hi,Can anyone suggest me, how to incorporate GMail like chat in my existing ASP.Net application.I wa

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

SQL Injection
In my attempts to protect my database from mySQL injection I have created another problem for myself

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

Change log of Cost centre change in Plant maintenance order
Hi,
How to view Change log of Cost centre in Plant maintenance order. Not visible thru 'Docume

How to submit a form to the same page?
I have a table containing information about books in my library and this table has the following col

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