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

Pro-rata Billing in Periodic Billing for Rental
Hi guys,

We have a situation, where a rental contract starts at the mid of the month say

Product categories for registration
Dear all,

We are going live with the Supplier registered next week. At standard, the 'sel

Including calander to page - will not show other months than current??
im trying to add an existaing calander onto a profile page by using Code: <?php include "

Parse XML
Good day,

I use oempro software and try to parse XMLReturn but it's not working for me, simpl

Suggestions for Functional module
Hello experts,
I Have done B.Sc(Mathematics) and MCA & have learnt SAP/ABAP but do n

Page Reload
I am having issues getting a page to reload after I submit data to a database. This form should inp

Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I

same querie, or a new one??
Hi guys,

I'm still working on this drop down list. I've got the actual drop down list to wor

big pagination problem in php
<?php

$connect = mysql_connect("localhost", "root", "")

couldn't connect to your database
Hello I am new to php mysql

Actually i have read A tutorial on nettuts
"http://net.tu

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