cvs: phpdoc-zh /language functions.xml

From: Date: Sun, 14 Jul 2002 10:06:16 +0000
Subject: cvs: phpdoc-zh /language functions.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-80@lists.php.net to get a copy of this message
verdana Sun Jul 14 06:06:16 2002 EDT Modified files: /phpdoc-zh/language functions.xml Log: no message Index: phpdoc-zh/language/functions.xml diff -u phpdoc-zh/language/functions.xml:1.1 phpdoc-zh/language/functions.xml:1.2 --- phpdoc-zh/language/functions.xml:1.1 Sun Jul 14 05:47:25 2002 +++ phpdoc-zh/language/functions.xml Sun Jul 14 06:06:16 2002 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <chapter id="functions"> <title>º¯Êý</title> @@ -93,16 +93,13 @@ <title>ͨ¹ýÒýÓô«µÝ²ÎÊý</title> <simpara> - By default, function arguments are passed by value (so that if - you change the value of the argument within the function, it does - not get changed outside of the function). If you wish to allow a - function to modify its arguments, you must pass them by - reference. + ȱʡÇé¿öÏ£¬º¯Êý²ÎÊýͨ¹ýÖµ´«µÝ£¨Òò¶ø¼´Ê¹ÔÚº¯ÊýÄÚ²¿¸Ä±ä²ÎÊýµÄÖµ£¬Ëü + ²¢²»»á¸Ä±äº¯ÊýÍⲿµÄÖµ£©¡£Èç¹ûÄãÏ£ÍûÔÊÐíº¯ÊýÐÞ¸ÄËüµÄ²ÎÊýÖµ£¬Äã±ØÐë + ͨ¹ýÒýÓô«µÝ²ÎÊý¡£ </simpara> <para> - If you want an argument to a function to always be passed by - reference, you can prepend an ampersand (&amp;) to the argument - name in the function definition: + Èç¹ûÏëÒªº¯ÊýµÄÒ»¸ö²ÎÊý×ÜÊÇͨ¹ýÒýÓô«µÝ£¬Äã¿ÉÒÔÔÚº¯Êý¶¨ÒåÖиòÎÊýµÄ + Ç°ÃæÔ¤ÏȼÓÉÏ·ûºÅ£¨&£©£º <informalexample> <programlisting role="php"> @@ -125,8 +122,7 @@ <title>ĬÈϲÎÊýµÄÖµ</title> <para> - A function may define C++-style default values for scalar - arguments as follows: + º¯Êý¿ÉÒÔ¶¨Òå C++ ·ç¸ñµÄ±êÁ¿²ÎÊýĬÈÏÖµ£¬ÈçÏ£º <informalexample> <programlisting role="php"> @@ -143,8 +139,7 @@ </para> <para> - The output from the above snippet is: - + ÉÏÊöƬ¶ÏµÄÊä³öÊÇ£º <screen> Making a cup of cappuccino. Making a cup of espresso. @@ -152,14 +147,12 @@ </para> <simpara> - The default value must be a constant expression, not (for - example) a variable or class member. + ĬÈÏÖµ±ØÐëÊDZêÁ¿£¬²»ÊÇ£¨±ÈÈ磩±äÁ¿»òÕßÀà³ÉÔ±¡£ </simpara> <para> - Note that when using default arguments, any defaults should be on - the right side of any non-default arguments; otherwise, things - will not work as expected. Consider the following code snippet: - + Çë×¢Ò⵱ʹÓÃĬÈϲÎÊýʱ£¬ÈκÎĬÈϲÎÊý±ØÐë·ÅÔÚÈκηÇĬÈϲÎÊýµÄÓҲࣻ·ñÔò£¬ + ¿ÉÄܺ¯Êý½«²»»á°´ÕÕÔ¤ÆÚµÄÇé¿ö¹¤×÷¡£¿¼ÂÇÏÂÃæµÄ´úÂëÆ¬¶Ï£º + <informalexample> <programlisting role="php"> <![CDATA[ @@ -175,7 +168,7 @@ </para> <para> - The output of the above example is: + ÉÏÊöÀý×ÓµÄÊä³öʱ£º <screen> Warning: Missing argument 2 in call to makeyogurt() in @@ -185,8 +178,7 @@ </para> <para> - Now, compare the above with this: - + ÏÖÔÚ£¬±È½ÏÉÏÃæµÄÀý×ÓºÍÕâ¸öÀý×Ó£º <informalexample> <programlisting role="php"> <![CDATA[ @@ -202,7 +194,7 @@ </para> <para> - The output of this example is: + Õâ¸öÀý×ÓµÄÊä³öÊÇ£º <screen> Making a bowl of acidophilus raspberry.

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