cvs: phpdoc-zh /reference/classobj/functions get-class-methods.xml

From: Date: Fri, 16 Dec 2005 02:49:49 +0000
Subject: cvs: phpdoc-zh /reference/classobj/functions get-class-methods.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-2719@lists.php.net to get a copy of this message
dallas Fri Dec 16 02:49:49 2005 EDT Modified files: /phpdoc-zh/reference/classobj/functions get-class-methods.xml Log: Updated. http://cvs.php.net/viewcvs.cgi/phpdoc-zh/reference/classobj/functions/get-class-methods.xml?r1=1.1&r2=1.2&diff_format=u Index: phpdoc-zh/reference/classobj/functions/get-class-methods.xml diff -u phpdoc-zh/reference/classobj/functions/get-class-methods.xml:1.1 phpdoc-zh/reference/classobj/functions/get-class-methods.xml:1.2 --- phpdoc-zh/reference/classobj/functions/get-class-methods.xml:1.1 Mon Mar 31 14:05:34 2003 +++ phpdoc-zh/reference/classobj/functions/get-class-methods.xml Fri Dec 16 02:49:49 2005 @@ -1,63 +1,66 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.1 $ --> -<!-- $Author: nio $ --> -<!-- EN-Revision: 1.3 Maintainer: nio Status: ready --> +<!-- $Revision: 1.2 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.11 Maintainer: nio Status: ready --> <!-- splitted from ./en/functions/classobj.xml, last change in rev 1.2 --> - <refentry id="function.get-class-methods"> - <refnamediv> - <refname>get_class_methods</refname> - <refpurpose>·µ»ØÓÉÀàµÄ·½·¨Ãû×é³ÉµÄÊý×é</refpurpose> - </refnamediv> - <refsect1> - <title>ÃèÊö</title> - <methodsynopsis> - <type>array</type><methodname>get_class_methods</methodname> - <methodparam><type>mixed</type><parameter>class_name</parameter></methodparam> - </methodsynopsis> - <para> - ·µ»ØÓÉ <parameter>class_name</parameter> - Ö¸¶¨µÄÀàÖж¨ÒåµÄ·½·¨ÃûËù×é³ÉµÄÊý×é¡£ - </para> - <note> - <para> - ´Ó PHP 4.0.6 ¿ªÊ¼£¬¿ÉÒÔÖ¸¶¨¶ÔÏó±¾ÉíÀ´´úÌæ - <parameter>class_name</parameter>£¬ÀýÈ磺 - <informalexample> - <programlisting> +<refentry id="function.get-class-methods"> + <refnamediv> + <refname>get_class_methods</refname> + <refpurpose>·µ»ØÓÉÀàµÄ·½·¨Ãû×é³ÉµÄÊý×é</refpurpose> + </refnamediv> + <refsect1> + <title>˵Ã÷</title> + <methodsynopsis> + <type>array</type><methodname>get_class_methods</methodname> + <methodparam><type>mixed</type><parameter>class_name</parameter></methodparam> + </methodsynopsis> + <para> + ·µ»ØÓÉ <parameter>class_name</parameter> + Ö¸¶¨µÄÀàÖж¨ÒåµÄ·½·¨ÃûËù×é³ÉµÄÊý×é¡£Èç¹û³ö´í£¬Ôò·µ»Ø &null;¡£ + </para> + <note> + <para> + ´Ó PHP 4.0.6 ¿ªÊ¼£¬¿ÉÒÔÖ¸¶¨¶ÔÏó±¾ÉíÀ´´úÌæ + <parameter>class_name</parameter>£¬ÀýÈ磺 + <informalexample> + <programlisting role="php"> <![CDATA[ +<?php $class_methods = get_class_methods($my_class); // see below the full example +?> ]]> - </programlisting> - </informalexample> - </para> - </note> - <para> - <example> - <title><function>get_class_methods</function> ʾÀý</title> - <programlisting role="php"> + </programlisting> + </informalexample> + </para> + </note> + <para> + <example> + <title><function>get_class_methods</function> ʾÀý</title> + <programlisting role="php"> <![CDATA[ <?php class myclass { // constructor - function myclass() { - return(TRUE); + function myclass() + { + return(true); } // method 1 - function myfunc1() { - return(TRUE); + function myfunc1() + { + return(true); } // method 2 - function myfunc2() { - return(TRUE); + function myfunc2() + { + return(true); } } -$my_object = new myclass(); - -$class_methods = get_class_methods(get_class($my_object)); +$class_methods = get_class_methods('my_object'); foreach ($class_methods as $method_name) { echo "$method_name\n"; @@ -65,27 +68,28 @@ ?> ]]> - </programlisting> - </example> - </para> - <para> - ÔËÐнá¹û£º - <informalexample> - <programlisting> + </programlisting> + &example.outputs; + <screen> <![CDATA[ myclass myfunc1 myfunc2 ]]> - </programlisting> - </informalexample> - </para> - <simpara> - ²Î¼û <function>get_class_vars</function> ºÍ - <function>get_object_vars</function>¡£ - </simpara> - </refsect1> - </refentry> + </screen> + </example> + </para> + <warning> + <para> + ×Ô PHP 5 Æð£¬±¾º¯Êý°´ÕÕ·½·¨±»¶¨ÒåµÄÃû×Ö·µ»Ø£¨Çø·Ö´óСд£©¡£ÔÚ PHP 4 ÖÐ×ÜÊÇ·µ»ØÐ¡Ð´µÄ¡£ + </para> + </warning> + <simpara> + ²Î¼û <function>get_class</function>£¬<function>get_class_vars</function> ºÍ + <function>get_object_vars</function>¡£ + </simpara> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables:

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