<?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.interface-exists"> <refnamediv> <refname>interface_exists</refname> <refpurpose>Checks if the interface has been defined</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>interface_exists</methodname> <methodparam><type>string</type><parameter>interface_name</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>autoload</parameter></methodparam> </methodsynopsis> <para> This function returns &true; if the interface given by <parameter>interface_name</parameter> has been defined, &false; otherwise. </para> <para> <example> <title><function>interface_exists</function> example</title> <programlisting role="php"> <![CDATA[ <?php // Check the interface exists before trying to use it if (interface_exists('MyInterface')) { class MyClass implements MyInterface { // Methods } } ?> ]]> </programlisting> </example> </para> <para> <function>interface_exists</function> will attempt to call &link.autoload; by default, if you don't want <function>interface_exists</function> to call &link.autoload;, you can set the parameter <parameter>autoload</parameter> to &false;. </para> <simpara> See also <function>class_exists</function>. </simpara> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->