I am having a problem with detecting if an interface class is already declared
Error reported is:
Fatal error: Cannot redeclare class iSerializable in /public_html/application/AppCode/iSerializable.interface.php on line 3
line1: //nothing here
line2: require_once($filename);
line3: interface iSerializable
{
public function writeXML(DomDocument $doc, DomElement $element);
}
If this was a normal class, then i would have used this example function given below
if(class_exists('iSerializable') != true)
{
//put class iSerializable here
}
but here, this class is an Interface, how can i check if this interface is already declared?
Can any one kindly suggest me a proper way or solution to this problem?
You can use
interface_exists()