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?
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

User information
Hi All,
By using t-code SUIM we get all the user details,if suppose we donot have permission t

Hom to make one url to open together with another url
I have a chat, which i want to be opened, as soon as the users login to the site. As it is now, when

Relative path
I have a absolute path to an image - like so: C:/Program Files/Apache Software Foundation/Apache2.2/

Can't find the problem (no error message)!
OK, here's the deal. This code is really weirdly formatted (sorry!) and hard to understand, so I'm g

Breaking results into week blocks
I have a set of dates (and times), which are returned from a mySQL query.

These usually span

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

Problem with PHP/mySQL login code
Hello,

There is an error in my login script and I can't figure out what it is...
I believe

PHP SUBMIT
Code: <input name="doLogin" type="image" src="images/loginsubmit.jpg

Big O & time complexity ???
can you help me how to calculate the Big O & time complexity for any algorithm and c++ program pleas

Session login issue
I'm wondering how to fix a problem I'm having with a session-based login system

Say I go to h

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