(PHP 5 >= 5.0.2, PHP 7)
interface_exists — 检查接口是否已被定义
$interface_name
   [, bool $autoload = true
  ] )检查接口是否已被定义。
   本函数在由 interface_name
   给出的接口已定义时返回 TRUE,否则返回 FALSE。
  
Example #1 interface_exists() 例子
<?php
// 在尝试使用前先检查接口是否存在
if (interface_exists('MyInterface')) {
    class MyClass implements MyInterface
    {
        // Methods
    }
}
?>