cvs: phpdoc-zh /language functions.xml

From: Date: Sun, 14 Jul 2002 15:00:52 +0000
Subject: cvs: phpdoc-zh /language functions.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-83@lists.php.net to get a copy of this message
verdana Sun Jul 14 11:00:52 2002 EDT Modified files: /phpdoc-zh/language functions.xml Log: complete translation Index: phpdoc-zh/language/functions.xml diff -u phpdoc-zh/language/functions.xml:1.2 phpdoc-zh/language/functions.xml:1.3 --- phpdoc-zh/language/functions.xml:1.2 Sun Jul 14 06:06:16 2002 +++ phpdoc-zh/language/functions.xml Sun Jul 14 11:00:50 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <chapter id="functions"> <title>º¯Êý</title> @@ -59,23 +59,19 @@ <title>º¯ÊýµÄ²ÎÊý</title> <simpara> - Information may be passed to functions via the argument list, - which is a comma-delimited list of variables and/or constants. + ͨ¹ý²ÎÊýÁбí¿ÉÒÔ´«µÝÐÅÏ¢µ½º¯Êý£¬¸ÃÁбíÊÇÒÔ¶ººÅ×÷Ϊ·Ö¸ô·ûµÄº¯Êý + ºÍ/»ò³£Á¿ÁÐ±í¡£ </simpara> <para> - PHP supports passing arguments by value (the default), <link - linkend="functions.arguments.by-reference">passing by - reference</link>, and <link - linkend="functions.arguments.default">default argument - values</link>. Variable-length argument lists are supported only - in PHP 4 and later; see <link - linkend="functions.variable-arg-list">Variable-length argument - lists</link> and the function references for - <function>func_num_args</function>, - <function>func_get_arg</function>, and - <function>func_get_args</function> for more information. A - similar effect can be achieved in PHP 3 by passing an array of - arguments to a function: + PHP Ö§³Ö°´Öµ´«µÝ²ÎÊý£¨Ä¬ÈÏ£©, + <link linkend="functions.arguments.by-reference">ͨ¹ýÒýÓô«µÝ</link>, ºÍ + <link linkend="functions.arguments.default">ĬÈϲÎÊýÖµ</link>. + ¿É±ä³¤¶È²ÎÊýÁбí½öÔÚ PHP 4 ºÍºóÐø°æ±¾ÖÐÖ§³Ö£»¸ü¶àÐÅÏ¢Çë²ÎÕÕ <link + linkend="functions.variable-arg-list">¿É±ä³¤¶È²ÎÊýÁбí</link> + ºÍÉæ¼°µ½µÄÏà¹Øº¯Êý <function>func_num_args</function>£¬ + <function>func_get_arg</function>, ºÍ + <function>func_get_args</function>¡£ + PHP 3 ÖÐͨ¹ý´«µÝÒ»¸öÊý×é²ÎÊý¿ÉÒÔ´ïµ½ÀàËÆµÄЧ¹û£º <informalexample> <programlisting role="php"> @@ -204,20 +200,16 @@ </sect2> <sect2 id="functions.variable-arg-list"> - <title>Variable-length argument lists</title> + <title>¿É±ä³¤¶È²ÎÊýÁбí</title> <simpara> - PHP 4 has support for variable-length argument lists in - user-defined functions. This is really quite easy, using the - <function>func_num_args</function>, - <function>func_get_arg</function>, and - <function>func_get_args</function> functions. + PHP 4 ÒѾ­ÔÚÓû§×Ô¶¨Ò庯ÊýÖÐÖ§³Ö¿É±ä³¤¶È²ÎÊýÁÐ±í¡£Õâ¸öÕæµÄºÜ¼òµ¥£¬ + ʹÓà <function>func_num_args</function>£¬<function>func_get_arg</function>£¬ºÍ + <function>func_get_args</function> º¯Êý. </simpara> <simpara> - No special syntax is required, and argument lists may still be - explicitly provided with function definitions and will behave as - normal. + ÎÞÐèÌØ±ðµÄÓï·¨£¬²ÎÊýÁбí¿ÉÄÜÈÔÈ»±»Ã÷°×ÎÞÎóµÄ´«µÝ¸øº¯Êý²¢Õý³£ÔËת¡£ </simpara> </sect2> @@ -228,11 +220,9 @@ <title>·µ»ØÖµ</title> <para> - Values are returned by using the optional return statement. Any - type may be returned, including lists and objects. This causes the - function to end its execution immediately and pass control back to - the line from which it was called. See <function>return</function> - for more information. + ֵͨ¹ýʹÓÿÉÑ¡µÄ·µ»ØÓï¾ä·µ»Ø¡£ÈκÎÀàÐͶ¼¿ÉÒÔ·µ»Ø£¬°üÀ¨ÁбíºÍ¶ÔÏó¡£ + Õâµ¼Öº¯ÊýÁ¢¼´½áÊøËüµÄÔËÐУ¬²¢ÇÒ½«¿ØÖÆÈ¨´«µÝ»ØËü±»µ÷ÓõÄÐС£¸ü¶àÐÅÏ¢ + Çë²ÎÕÕ <function>return</function>¡£ <informalexample> <programlisting role="php"> <![CDATA[ @@ -296,14 +286,11 @@ </simpara> <warning> <para> - Functions declared as <literal>old_function</literal> cannot be - called from PHP's internal code. Among other things, this means - you can't use them in functions such as - <function>usort</function>, <function>array_walk</function>, and - <function>register_shutdown_function</function>. You can get - around this limitation by writing a wrapper function (in normal - PHP 3 form) to call the <literal>old_function</literal>. - + ÒÔ <literal>old_function</literal> ÉùÃ÷µÄº¯ÊýÎÞ·¨´Ó PHP µÄÄÚ²¿´úÂëµ÷Óᣠ+ ³ýÁ˱ðµÄÊÂÇéÒÔÍâ, ÕâÒâζ×ÅÄã²»ÄÜÔÚÖîÈç <function>usort</funtion>£¬ + <function>array_walk</function>£¬ºÍ <function>register_shutdown_function</function> + µÈº¯ÊýÖÐʹÓÃËüÃÇ¡£Äã¿ÉÒÔͨ¹ýдһ¸öÍâ¿Çº¯Êý£¨ÒÔÕý³£µÄ PHP 3 ÐÎʽ£©À´ + µ÷Óà <literal>old_function</literal>¡£ </para> </warning> @@ -311,27 +298,24 @@ </sect1> <sect1 id="functions.variable-functions"> - <title>Variable functions</title> + <title>±äÁ¿º¯Êý</title> <para> - PHP supports the concept of variable functions. This means that if - a variable name has parentheses appended to it, PHP will look for - a function with the same name as whatever the variable evaluates - to, and will attempt to execute it. Among other things, this can - be used to implement callbacks, function tables, and so forth. - </para> + PHP Ö§³Ö±äÁ¿º¯ÊýµÄ¸ÅÄî¡£ÕâÒâζ×ÅÈç¹ûÒ»¸ö±äÁ¿ÃûºóÓÐÔ²À¨ºÅ£¬PHP ½«Ñ°ÕÒ + Óë±äÁ¿µÄÖµÏàͬµÄº¯Êý£¬²¢ÇÒ½«³¢ÊÔÖ´ÐÐËü¡£³ýÁ˱ðµÄÊÂÇéÒÔÍ⣬Õâ¸ö¿ÉÒÔ±» + ÓÃÓÚʵÏֻص÷º¯Êý£¬º¯Êý±íµÈµÈ¡£ + </para> <para> - Variable functions won't work with language constructs such - as <function>echo</function>, <function>unset</function>, - <function>isset</function>, <function>empty</function> and - <function>include</function>. Although, the construct - <function>print</function> is an exception and will work. - This is one of the major differences between PHP functions and - language constructs. + ±äÁ¿º¯Êý²»ÄÜÓÃÓÚÓïÑԽṹ£¬ÀýÈç <function>echo</function>£¬ + <function>unset</function>£¬<function>isset</function>£¬ + <function>empty</function> ºÍ <function>include</function>¡£ + ¾¡¹ÜÈç´Ë£¬½á¹¹ <function>print</function> È´ÊǸöÀýÍ⣬¿ÉÒÔÔËÐС£ + ÕâÊÇ PHP º¯ÊýºÍÓïÑԽṹ֮¼äµÄÖ÷Òª²»Í¬Ö®Ò»¡£ + </para> <para> <example> - <title>Variable function example</title> + <title>±äÁ¿º¯ÊýʾÀý</title> <programlisting role="php"> <![CDATA[ <?php @@ -355,8 +339,8 @@ </example> </para> <para> - See also <link linkend="language.variables.variable"> - variable variables</link> and <function>function_exists</function>. + Ïà¹ØÄÚÈݲο¼ <link linkend="language.variables.variable"> + ±äÁ¿µÄ±äÁ¿</link> ºÍ <function>function_exists</function>. </para> </sect1>

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