cvs: phpdoc-zh /reference/spl/functions class-implements.xml

From: Date: Sat, 13 Dec 2008 06:23:02 +0000
Subject: cvs: phpdoc-zh /reference/spl/functions class-implements.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-3050@lists.php.net to get a copy of this message
eniac2008 Sat Dec 13 06:23:02 2008 UTC Added files: /phpdoc-zh/reference/spl/functions class-implements.xml Log: Add new file http://cvs.php.net/viewvc.cgi/phpdoc-zh/reference/spl/functions/class-implements.xml?view=markup&rev=1.1 Index: phpdoc-zh/reference/spl/functions/class-implements.xml +++ phpdoc-zh/reference/spl/functions/class-implements.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <!-- $Author: eniac2008 $ --> <!-- EN-Revision: 1.14 Maintainer: Altair Status: ready --> <refentry xml:id="function.class-implements" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>class_implements</refname> <refpurpose> 返回指定的类实现的所有接口。 </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>array</type><methodname>class_implements</methodname> <methodparam><type>mixed</type><parameter>class</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>autoload</parameter></methodparam> </methodsynopsis> <para> 本函数返回一个数组,该数组中包含了指定类<parameter>class</parameter>及其父类所实现的所有接口的名称。 </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>class</parameter></term> <listitem> <para> 对象(类实例)或字符串(类名称)。 </para> </listitem> </varlistentry> <varlistentry> <term><parameter>autoload</parameter></term> <listitem> <para> 是否允许使用<link linkend="language.oop5.autoload">__autoload</link> 魔术函数来自动装载该类。默认值为&true;。 </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> 调用成功则返回一个数组,否则返回&false;。 </para> </refsect1> <refsect1 role="changelog"> &reftitle.changelog; <para> <informaltable> <tgroup cols="2"> <thead> <row> <entry>&Version;</entry> <entry>&Description;</entry> </row> </thead> <tbody> <row> <entry>5.1.0</entry> <entry> 增加了允许参数<parameter>class</parameter>为字符串的选项。增加了<parameter>autoload</parameter>参数。 </entry> </row> </tbody> </tgroup> </informaltable> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>class_implements</function> example</title> <programlisting role="php"> <![CDATA[ <?php interface foo { } class bar implements foo {} print_r(class_implements(new bar)); // since PHP 5.1.0 you may also specify the parameter as a string print_r(class_implements('bar')); function __autoload($class_name) { require_once $class_name . '.php'; } // use __autoload to load the 'not_loaded' class print_r(class_implements('not_loaded', true)); ?> ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ Array ( [foo] => foo ) Array ( [interface_of_not_loaded] => interface_of_not_loaded ) ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>class_parents</function></member> <member><function>get_declared_interfaces</function></member> </simplelist> </para> </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 -->

« previous php.doc.zh (#3050) next »