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

PHP referral database. I would like this form to email the referrer.
Okay, Hello I've been trolling for years. This the first time I've ever asked for php help. Normally

Word Trimming
Hi Guys & Gals!!

Hope you are all ok....

I need some help with the following

Credit card verification
I have a client who wants to process credit card transactions from his web site rather than the goin

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

php slowing my site?
Hi all,

I think that one of the reasons that my site doesn't work fast is that the code is ve

Login page problems
I developed a website a few months ago and I am now having an issue with logging into it. The place

Simple program to copy files between two computers over the web
I use logmein free and often need to move files between my two computers. Generally, I move the file

C problem struct and string
Hi guys,

This is my first post and I'm hoping the experts here can help me solve my problem.<

How to find OS bit version
How can I tell the person browsing my site is running 32, or 64 bit operating system?

Little problem with form insertion in MySQL, Please help!!!
Hi!,

I'm a little bit new with php and I have a little issue here. I created a webform to ins

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