User:Dhirajha

Classic type of object in the OO world is an interface. An interface is an object that describes a set of methods that a class may choose to implement. An interface looks like this: interface interf { public function f1($x,$y,...,); public function f2(....); …. public function fn(...); } Note that there is no specification of the method code, just the name and the number of arguments. A class can choose to implement an interface, like this: class c extends parent implements interf { (all functions listed in the interface must now be defined) … ) Interfaces can inherit from one another, just like classes do. The syntax is also identical: interface interf2 extends interf1 { function f1(...); }