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

Need help Updating SQL Server Express DB from c# :(
Please can anyone help with:-
1 How to sructure the strSelect statement.
2 How to instruct

Connection Timeout
I'm using xmii 12.0

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

Blocking video streaming
Hello everyone,

I post a message here because i didn't find any solution yet.
I just finis

Having a problem get the selected item from a drop down menu
I have been looking at this for days now.

I have a drop down menu that get it's values from a

Error: SQL Syntax; Line 1
Code:

<?php require "global_settings.php"; ?>
<title&g

Header redirect
Hello ive got a problem ive got form with its action set to itself.
Code: <form id="f

cURL proxy
Okay here is the thing... i know how to add proxys

Code: curl_setopt($ch, CURLOPT_PROXYTYPE,

help removing unwanted graphic
How do I remove the small elongated rectangular shape between the "Latest post" and "

trim function issues
Hi guys, total noob here...

So I've been tinkering around with a html and am using php to em

Schedule editor
Hi,

I have a question related to Schedule editor.
If we schedule a BLS for every 30

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