<?php
interface b
{
public void function abc();
public void function xyz();
}
class Myclass implements b
{
//remember that after this you won't afford to not define anyone function mentioned in Interface
//You may need to define both
//you can define more functions other than you declare in Inferface
var $a,$b;
function __construct($aa,$bb)
{
$this->a=$aa;
$this->b=$bb;
}
function abc()
{
return $this->a;
}
function xyz
{
return $this->b;
}
}
$obj= new Myclass("Addison","Cave");
$obj->abc();
$obj->xyz();
// but on time of crating objects it's not to use both functions
?>
Bookmarks