Skip to Content
PHPCODE
Interfaces in php
oops code / August 11, 2018
<?php
interface abc {
public function test();
public function xyz();
}
class def implements abc {
public function test()
{
echo “hello”;
}
public function xyz()
{
echo “hii”;
}
}
?><?php//interface may not include member variables
//not interface private and protected not declar
abstract class def
{
public $data;
}

interface a {
public function abc();

}
interface b {

public function xyz();
}
class c implements a,b
{
public $a;
public function abc()
{
echo “Hello”;
}
public function xyz()
{
echo “Hii”;
}
}
?>

PHPCODE © 2024