cvs: phpdoc /kr/language control-structures.xml
| From: | WonHee Hwang | Date: | Thu, 11 Jan 2001 03:35:30 +0000 |
| Subject: | cvs: phpdoc /kr/language control-structures.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969333551@lists.php.net to get a copy of this message | ||
regina Wed Jan 10 19:35:30 2001 EDT
Modified files:
/phpdoc/kr/language control-structures.xml
Log:
Index: phpdoc/kr/language/control-structures.xml diff -u phpdoc/kr/language/control-structures.xml:1.3 phpdoc/kr/language/control-structures.xml:1.4 --- phpdoc/kr/language/control-structures.xml:1.3 Wed Jan 10 02:54:00 2001 +++ phpdoc/kr/language/control-structures.xml Wed Jan 10 19:35:29 2001 @@ -196,7 +196,7 @@ <literal>while</literal> </title> <para> - <literal>while</literal> 루íë PHPì ê°ì¥ ê°ë¨í ì ì´êµ¬ì¡°ì´ë¤. + <literal>while</literal> 루íë PHPì ê°ì¥ ê°ë¨í ì ì´êµ¬ì¡°ì´ë¤. ì´ê²ì Cì ëì¼íê² ìëíë¤. <literal>while</literal>ì 기본 ííë ë¤ìê³¼ ê°ë¤. : <informalexample> <programlisting> @@ -258,7 +258,7 @@ <literal>do..while</literal> </title> <simpara> - <literal>do..while</literal> 루íë ë¹êµìì´ ìì´ ìë 맨 ë¤ì ìë¤ë ì ì ì ì¸íë©´ + <literal>do..while</literal> 루íë ë¹êµìì´ ìì´ ìë 맨 ë¤ì ìë¤ë ì ì ì ì¸íë©´ <literal>while</literal> 루íì ë¹ì·íë¤. The main difference from regular <literal>while</literal> loops is that the first iteration of a <literal>do..while</literal> loop is @@ -325,7 +325,7 @@ <literal>for</literal> </title> <para> - <literal>for</literal> 루íë PHPìì ê°ì¥ ë³µì¡í 루íì´ë¤. + <literal>for</literal> 루íë PHPìì ê°ì¥ ë³µì¡í 루íì´ë¤. ì´ê²ì ííì Cì ë§¤ì° ì ì¬íë¤. <literal>for</literal> 루íì 문ë²ì ë¤ìê³¼ ê°ë¤. : <informalexample> <programlisting> @@ -348,7 +348,8 @@ ê° íê°ìì ë¹ìë ì ìë¤. <replaceable>expr2</replaceable>ê° ë¹ì´ìì¼ë©´ 무í 루í를 ë»íë¤. (PHPë Cì ê°ì´ ë¹ì´ìì¼ë©´ TRUEë¡ ì¸ìíë¤.) ì´ê±´ ë³ë¡ ì¢ì ë°©ë²ì´ ìëì§ë§, ì¢ ì¢ ì´ë ê² ì¬ì©íê³ <link linkend="control-structures.break"> - <literal>break</literal></link>를 ì¬ì©íì¬ ì¢ ë£íë ë°©ë²ë ìë¤. + <literal>break</literal> + </link>를 ì¬ì©íì¬ ì¢ ë£íë ë°©ë²ë ìë¤. </simpara> <para> ë¤ì ìë 1ìì 10ê¹ì§ ì¶ë ¥íë ìì ë¤ì´ë¤. : @@ -434,7 +435,7 @@ <para> <note> <para> - <literal>foreach</literal> ë¬¸ì´ ì²ì ìíë ë, ë´ë¶ ë°°ì´ í¬ì¸í°(internal array pointer)ë + <literal>foreach</literal> ë¬¸ì´ ì²ì ìíë ë, ë´ë¶ ë°°ì´ í¬ì¸í°(internal array pointer)ë ìëì ì¼ë¡ ë°°ì´ì 첫ë²ì§¸ ììë¡ ì¤ì ëë¤. ì´ë§ì ì미ë ì¬ë¬ë¶ì´ <literal>foreach</literal>문ì ì¬ì©í ë <function>reset</function>ì 미리 í¸ì¶í íìë ìë¤ë ê²ì´ë¤. </para> @@ -520,12 +521,12 @@ <literal>break</literal> </title> <simpara> - <literal>break</literal>ë <literal>for</literal>ë, <literal>while</literal>, <literal>switch</literal>ìì ë¹ ì ¸ ëê°ë ëª ë ¹ì´ë¤. + <literal>break</literal>ë <literal>for</literal>ë, <literal>while</literal>, + <literal>switch</literal>ìì ë¹ ì ¸ ëê°ë ëª ë ¹ì´ë¤. </simpara> <simpara> - <literal>break</literal> accepts an optional numeric argument - which tells it how many nested enclosing structures are to be - broken out of. + <literal>break</literal>ìë ì«ì ìµì ì ì¤ ì ìëë°, + ì´ê²ì íë²ì ë¹ ì ¸ ëê° ì ì´ êµ¬ì¡°ì ì를 ì미íë¤. </simpara> <para> <informalexample> @@ -562,14 +563,11 @@ <literal>continue</literal> </title> <simpara> - <literal>continue</literal> is used within looping structures to - skip the rest of the current loop iteration and continue execution - at the beginning of the next iteration. + <literal>continue</literal> ë íì¬ ë£¨íì ì²ìì¼ë¡ ê°ëë¡ íë ëª ë ¹ì´ë¤. </simpara> <simpara> - <literal>continue</literal> accepts an optional numeric argument - which tells it how many levels of enclosing loops it should skip - to the end of. + <literal>continue</literal>ë ì«ì ìµì ì ì¤ ì ìëë°, + ì´ê²ë <literal>break</literal>ììì ê°ì´ íë²ì ì²ìì¼ë¡ ê° ì ì´ êµ¬ì¡°ì ì를 ì미íë¤. </simpara> <para> <informalexample> @@ -603,18 +601,14 @@ <literal>switch</literal> </title> <simpara> - The <literal>switch</literal> statement is similar to a series of - IF statements on the same expression. In many occasions, you may - want to compare the same variable (or expression) with many - different values, and execute a different piece of code depending - on which value it equals to. This is exactly what the - <literal>switch</literal> statement is for. + <literal>switch</literal>문ì ë´ì©ì ëì¼í ííìì IF문ì ëì´í ê²ê³¼ ë¹ì·íë¤. + ë§ì ê²½ì°ì í ë³ì를 ì¬ë¬ ë¤ë¥¸ ê°ê³¼ ë¹êµíì¬, + ëê°ì ê°ì´ ê°ëëì ë°ë¼ ìë¡ ë¤ë¥¸ ì½ëë¤ì´ ìíë기를 ìíë ëê° ìë¤. + ë°ë¡ ì´ë° ê²½ì°ì <literal>switch</literal>ë¬¸ì´ ì¬ì©ëë¤. </simpara> <para> - The following two examples are two different ways to write the - same thing, one using a series of <literal>if</literal> - statements, and the other using the <literal>switch</literal> - statement: + ë¤ìì ëì¼í 결과를 ê°ì ¸ì¤ë ì를 ê°ê° <literal>if</literal>문과 + <literal>switch</literal>문ì¼ë¡ ííí ê²ì´ë¤. : <informalexample> <programlisting role="php"> if ($i == 0) { @@ -642,19 +636,11 @@ </informalexample> </para> <para> - It is important to understand how the <literal>switch</literal> - statement is executed in order to avoid mistakes. The - <literal>switch</literal> statement executes line by line - (actually, statement by statement). In the beginning, no code is - executed. Only when a <literal>case</literal> statement is found - with a value that matches the value of the - <literal>switch</literal> expression does PHP begin to execute the - statements. PHP continues to execute the statements until the end - of the <literal>switch</literal> block, or the first time it sees - a <literal>break</literal> statement. If you don't write a - <literal>break</literal> statement at the end of a case's - statement list, PHP will go on executing the statements of the - following case. For example: + <literal>switch</literal>문ì ë¬¸ì¥ ë¨ìë¡ ì¤íëë¤. + <literal>switch</literal>ì ìë íê°ìê³¼ ì¼ì¹íë <literal>case</literal>문ì ì°¾ì + ê·¸ ì´íë¶í° <literal>switch</literal> ë¸ëì´ ëë ëì 모ë 문ì¥ì ì¤ííë¤. + ë°ë¼ì ìíë ê²½ì° <literal>break</literal>ë¡ ì¤íì ì¤ì§ìí¬ íìê° ìë¤. + ë¤ì ì를 ë³´ì. : <informalexample> <programlisting role="php"> switch ($i) { @@ -669,13 +655,10 @@ </informalexample> </para> <simpara> - Here, if $i equals to 0, PHP would execute all of the print - statements! If $i equals to 1, PHP would execute the last two - print statements, and only if $i equals to 2, you'd get the - 'expected' behavior and only 'i equals 2' would be displayed. So, - it's important not to forget <literal>break</literal> statements - (even though you may want to avoid supplying them on purpose under - certain circumstances). + ì¬ê¸°ì $iê° 0ì´ë©´ 모ë print문ì ì¤íí ê²ì´ë¤. + ë§ì½ $iê° 1ì´ë©´ ë§ì§ë§ ëê°ì print문ì ì¤ííë¤. + ë°ë¼ì ê°ê°ì ê²½ì°ì íëì print 문ë§ì´ ì¤íë기를 ìíë¤ë©´, + <literal>break</literal>문ì ìì§ ììì¼íë¤. </simpara> <simpara> In a <literal>switch</literal> statement, the condition is @@ -703,8 +686,8 @@ </informalexample> </para> <para> - A special case is the default case. This case matches anything - that wasn't matched by the other cases. For example: + í¹ë³í caseë¡ default caseê° ìë¤. + ì´ê²ì ë¤ë¥¸ ì´ë¤ caseìë ë§ì§ ìë ê²½ì°ë¥¼ ì미íë¤. ì를 ë¤ì´ : <informalexample> <programlisting role="php"> switch ($i) { @@ -724,15 +707,13 @@ </informalexample> </para> <para> - The <literal>case</literal> expression may be any expression that - evaluates to a simple type, that is, integer or floating-point - numbers and strings. Arrays or objects cannot be used here unless - they are dereferenced to a simple type. + ë¤ë¥¸ ì¤ìí ì ì <literal>case</literal> ííììë ì ì, ì¤ì, 문ìì´ê°ì + ì¤ì¹¼ë¦¬ íì ì¼ë¡ íê°ëë ì´ë¤ ííìì´ìë ëë¤ë ê²ì´ë¤. + ë°°ì´ì´ë ê°ì²´ë ì¤ì¹¼ë¦¬ íì ì¼ë¡ ë³íìì¼ ì¬ì©íì§ ìë í ì¬ì©í ì ìë¤. </para> <para> - The alternative syntax for control structures is supported with - switches. For more information, see <link linkend="control-structures.alternative-syntax">Alternative syntax - for control structures</link> . + switch 문ì ëí´ìë Alternative syntaxê° ì§ìëë¤. ìì¸í ë´ì©ì + <link linkend="control-structures.alternative-syntax">Alternative syntax for control structures</link>를 ì´í´ë³´ì <informalexample> <programlisting role="php"> switch ($i): @@ -757,56 +738,43 @@ <function>require</function> </title> <simpara> - The <function>require</function> statement replaces itself with - the specified file, much like the C preprocessor's - <literal>#include</literal> works. + <function>require</function> 문ì C preprocessorì <literal>#include</literal>ì ë¹ì·íê², + ìì ì ì§ì ë íì¼ë¡ ëì²´íë¤. </simpara> <simpara> - If "URL fopen wrappers" are enabled in PHP (which they are in the - default configuration), you can specify the file to be - <function>require</function>ed using an URL instead of a local - pathname. See <link linkend="features.remote-files">Remote - files</link> and <function>fopen</function> for more information. + PHPìì "URL fopen wrappers"ê° enabledëì´ ìì¼ë©´ (기본ê°ì enabledì´ë¤.), + <function>require</function>ë í¨ìë¡ ì¼ë° íì¼ ë¿ ìëë¼ URLë ì¬ì©í ì ìë¤. + ìì¸í ë´ì©ì <link linkend="features.remote-files">Remote files</link>ì + <function>fopen</function>ì ì´í´ë³´ê¸° ë°ëë¤. + </simpara> + <simpara> + <function>include</function> ëê±°ë <function>require</function> ëì´ ì½íì§ë íì¼ì + í¬í¨ë íì¼ì ì²ìì PHP모ëìì ë¹ ì ¸ëì HTML모ëë¡ ë¤ì´ê°ê³ , ë§ì§ë§ì PHP모ëë¡ ë³µê·íë¤. + ë°ë¼ì í¬í¨ë íì¼ì PHP ì½ëë <link linkend="language.basic-syntax.phpmode">ì ì í PHP ìì, + ì¢ ë£ í</link>ì ëë¬ì¸ì¬ ìì´ì¼ íë¤. </simpara> <simpara> - An important note about how this works is that when a file is - <function>include</function>ed or <function>require</function>ed, - parsing drops out of PHP mode and into HTML mode at the beginning - of the target file, and resumes PHP mode again at the end. For - this reason, any code inside the target file which should be - executed as PHP code must be enclosed within <link linkend="language.basic-syntax.phpmode">valid PHP start and end - tags</link>. - </simpara> - <simpara> - <function>require</function> is not actually a function in PHP; - rather, it is a language construct. It is subject to some - different rules than functions are. For instance, - <function>require</function> is not subject to any containing - control structures. For another, it does not return any value; - attempting to read a return value from a - <function>require</function> call results in a parse error. - </simpara> - <simpara> - Unlike <function>include</function>, <function>require</function> - will <emphasis>always</emphasis> read in the target file, - <emphasis>even if the line it's on never executes</emphasis>. If - you want to conditionally include a file, use - <function>include</function>. The conditional statement won't - affect the <function>require</function>. However, if the line on - which the <function>require</function> occurs is not executed, - neither will any of the code in the target file be executed. - </simpara> - <simpara> - Similarly, looping structures do not affect the behaviour of - <function>require</function>. Although the code contained in the - target file is still subject to the loop, the - <function>require</function> itself happens only once. - </simpara> - <para> - This means that you can't put a <function>require</function> - statement inside of a loop structure and expect it to include the - contents of a different file on each iteration. To do that, use an - <function>include</function> statement. + <function>require</function>ë í¨ìê° ìëë¼ ì ì´êµ¬ì¡°ì´ë¤. + ë°ë¼ì ë¹ì°í í¨ììë ë¤ë¥¸ ê·ì¹ì ë°ë¥¸ë¤. + ì´ë¥¼í ë©´ <function>require</function>ë ë¤ë¥¸ ì´ë¤ ì ì´êµ¬ì¡°ìë í¨ê»ì¬ì©í ì ìë¤. + ëí, ì´ê²ì ë°íê°ì´ ìë¤. (ë°íê°ì ëë ¤ë°ì¼ë ¤íë©´ ë¬¸ë² ìë¬ê° ëë¤.) + </simpara> + <simpara> + <function>include</function>ì ë¤ë¥´ê², <function>require</function>ë ì¸ì ë í´ë¹ íì¼ì ì½ì´ì¨ë¤. + <emphasis>ì¬ì§ì´ í´ë¹ ë¼ì¸ì´ ì í ì¤íëì§ ììë ì½ì´ì¨ë¤.</emphasis> + ë§ì½ ì¡°ê±´ì ë°ë¼ íì¼ì í¬í¨ìí¤ê³ ì¶ë¤ë©´ <function>include</function>문ì ì¬ì©íì¬ì¼ íë¤. + ì¡°ê±´ì ì <function>require</function>문ì ì무 ìí¥ì 미ì¹ì§ 못íë¤. + ê·¸ë¬ë, <function>require</function>ë¬¸ì´ ìë ì¤ì´ ì¤íëì§ ìì¼ë©´ ì½ì´ì¨ íì¼ì ì´ë¤ ì½ëë ì¤íëì§ë ìëë¤. + </simpara> + <simpara> + ë§ì°¬ê°ì§ë¡, ìí문ë <function>require</function>문ì ìí¥ì ì£¼ì§ ëª»íë¤. + í¬í¨ë íì¼ì ì½ëê° ë£¨íì ì ì©ì ë°ê¸°ë íì§ë§, + <function>require</function> ëì ìì²´ë ë¨ì§ íë²ë§ ì¼ì´ëë ê²ì´ë¤. + </simpara> + <para> + ì´ê²ì 매 ìíìë§ë¤ ë¤ë¥¸ íì¼ì ì½ì´ì¤ë ¤ íë¤ë©´ + ìí문 ìì <function>require</function> 문ì ì¬ì©í´ìë ìëë¤ë ê²ì ì미íë¤. + ì´ë° ê²½ì°ìë <function>include</function>문ì ì¬ì©íì¬ì¼ íë¤ë ê²ì´ë¤. <informalexample> <programlisting role="php"> require ('header.inc'); @@ -857,13 +825,10 @@ </informalexample> </para> <simpara> - In PHP 3, it is possible to execute a <literal>return</literal> - statement inside a <function>require</function>ed file, as long as - that statement occurs in the global scope of the - <function>require</function>ed file. It may not occur within any - block (meaning inside braces ({}). In PHP 4, however, this ability - has been discontinued. If you need this functionality, see - <function>include</function>. + PHP3ììë <function>require</function>ë¡ í¬í¨ë íì¼ììì <literal>return</literal> 문ì ì¬ì©í ì ììë¤. + ë¨, return ë¬¸ì´ í¬í¨ë íì¼ì global scopeììë§ ê°ë¥íê³ , ì´ë í ë¸ë¡ë´({} ë´ë¶)ììë ì¬ì©í ì ìë¤. + ê·¸ë¬ë, PHP4ììë ì´ë° ê¸°ë¥ ìì²´ê° ìì´ì ¸ ë²ë ¸ë¤. + ë§ì½ ì¬ë¬ë¶ì´ ì´ë° 기ë¥ì ì¬ì©íê³ ì¶ë¤ë©´ <function>include</function>문ì ì¬ì©í기 ë°ëë¤. </simpara> <simpara> See also <function>include</function>, <function>require_once</function>, @@ -876,8 +841,7 @@ <function>include</function> </title> <simpara> - The <function>include</function> statement includes and evaluates - the specified file. + <function>include</function>문ì ì§ì í íì¼ì ì½ê³ ì¤ííë¤. </simpara> <simpara> If "URL fopen wrappers" are enabled in PHP (which they are in the @@ -887,19 +851,14 @@ files</link> and <function>fopen</function> for more information. </simpara> <simpara> - An important note about how this works is that when a file is - <function>include</function>ed or <function>require</function>ed, - parsing drops out of PHP mode and into HTML mode at the beginning - of the target file, and resumes again at the end. For this reason, - any code inside the target file which should be executed as PHP - code must be enclosed within <link linkend="language.basic-syntax.phpmode">valid PHP start and end - tags</link>. + <function>include</function>ëê±°ë <function>require</function> ëì´ ì½íì§ë íì¼ì + í¬í¨ë íì¼ì ì²ìì PHP모ëìì ë¹ ì ¸ëì HTML모ëë¡ ë¤ì´ê°ê³ , ë§ì§ë§ì PHP모ëë¡ ë³µê·íë¤. + ë°ë¼ì í¬í¨ë íì¼ì PHP ì½ëë <link linkend="language.basic-syntax.phpmode">ì ì í PHP ìì, ì¢ ë£ í</link>ì + ëë¬ì¸ì¬ ìì´ì¼ íë¤. </simpara> <para> - This happens each time the <function>include</function> statement - is encountered, so you can use an <function>include</function> - statement within a looping structure to include a number of - different files. + í´ë¹ íì¼ì ì½ì´ë¤ì´ë ëìì ì¤íì¤ <function>include</function> 문ì ë§ë ë ë§ë¤ ì¼ì´ëë¤. + ë°ë¼ì <function>include</function> 문ì 루í 구조 ìì ëì´ ë§¤ë² ë¤ë¥¸ íì¼ì ì½ì´ ë¤ì´ëë¡ í ì ìë¤. <informalexample> <programlisting role="php"> $files = array ('first.inc', 'second.inc', 'third.inc'); @@ -910,19 +869,14 @@ </informalexample> </para> <para> - <function>include</function> differs from - <function>require</function> in that the include statement is - re-evaluated each time it is encountered (and only when it is - being executed), whereas the <function>require</function> - statement is replaced by the required file when it is first - encountered, whether the contents of the file will be evaluated or - not (for example, if it is inside an <link linkend="control-structures.if">if</link> statement whose - condition evaluated to false). + <function>include</function>ë ì´ ë¬¸ì¥ì ë§ë ë ë§ë¤ ë§¤ë² ìë¡ ì½ì´ë¤ì´ê³ ì¤íëë¤ë ì ìì + <function>require</function>ì ë¤ë¥´ë¤. ë°ë©´ì require()문ì ì§ì ë íì¼ì ë´ì©ì´ ì¤íëëê°ì ê´ê³ìì´ + (ì를ë¤ì´ <link linkend="control-structures.if">if</link> 문 ìì ë¤ì´ìê³ ìíê° ê±°ì§ì¸ ê²½ì°ìë), + ì´ ë¬¸ì¥ì ì²ì ë§ë¬ì ë ì§ì ë íì¼ë¡ ëì²´ëë¤. </para> <para> - Because <function>include</function> is a special language - construct, you must enclose it within a statement block if it is - inside a conditional block. + <function>include</function>ë í¹ë³í 구조ì´ë¯ë¡, ë§ì½ ì´ê²ì´ ì¡°ì ì ìì ëì¬ìë¤ë©´ + ë°ëì {}(statement block)ì¼ë¡ ëë¬ì¸ì¼ íë¤. <informalexample> <programlisting role="php"> /* This is WRONG and will not work as desired. */ @@ -943,27 +897,20 @@ </informalexample> </para> <simpara> - In both PHP 3 and PHP 4, it is possible to execute a - <literal>return</literal> statement inside an - <function>include</function>ed file, in order to terminate - processing in that file and return to the script which called - it. Some differences in the way this works exist, however. The - first is that in PHP 3, the <literal>return</literal> may not - appear inside a block unless it's a function block, in which case - the <literal>return</literal> applies to that function and not the - whole file. In PHP 4, however, this restriction does not - exist. Also, PHP 4 allows you to return values from - <function>include</function>ed files. You can take the value of - the <function>include</function> call as you would a normal - function. This generates a parse error in PHP 3. + PHP3, PHP4 모ë <function>include</function>ë íì¼ ë´ìì, ì´ íì¼ë´ì ìíì ì¢ ë£íê³ , + ì´ íì¼ì ë¶ë¥¸ ì¤í¬ë¦½í¸ë¡ ë³µê·í기 ìí´ <literal>return</literal>문ì ì¬ì©í ì ìë¤. + ì½ê° ë¤ë¥¸ì ì´ ì기ëíë¤. ì°ì , PHP3ììë í´ë¹ ë¸ë¡ì´ í¨ìì ë¸ë¡ì´ ìëí return ë¬¸ì´ ë¸ë¡ìì ì¬ ì ìë¤. + (í¨ìì ë¸ë¡ ìì ìë ê²½ì°ë í´ë¹ í¨ììì return íë ê²ì´ì§ íì¬ íì¼ìì return íë ê²ì ìëë¤.) + ë°ëì Global scopeì ìì¹í´ì¼ íë¤. ê·¸ë¬ë, PHP4ììë ì´ ì íì´ ìë¤. + ëí PHP4ììë <function>include</function> íì¼ì <literal>return</literal>ìì 리í´ê°ì ì¬ì©í ì ìë¤. + <function>include</function>문ì ì¼ë° í¨ìì²ë¼ ì¬ì©íì¬ ë°íê°ì ë°ì ì ìë¤. + PHP3ììë ì´ë ê² ì¬ì©íë©´ 구문ìë¬ë¥¼ ë°ììí¨ë¤. </simpara> <example> <title> <function>include</function> in PHP 3 and PHP 4</title> <para> - Assume the existence of the following file (named - <filename>test.inc</filename>) in the same directory as the main - file: + ë¤ìì <filename>test.inc</filename>ë¼ë íì¼ì´ ë©ì¸ íì¼ê³¼ ëì¼í ëë í 리ì ìë¤ê³ ê°ì íë¤. : <programlisting role="php"> <?php echo "Before the return <br>\n"; @@ -975,8 +922,7 @@ </programlisting> </para> <para> - Assume that the main file (<filename>main.html</filename>) - contains the following: + <filename>main.html</filename> ì´ë¼ë ë©ì¸íì¼ì ë´ì©ì ë¤ìê³¼ ê°ë¤. : <programlisting role="php"> <?php $retval = include ('test.inc'); @@ -985,18 +931,17 @@ </programlisting> </para> <para> - When <filename>main.html</filename> is called in PHP 3, it will - generate a parse error on line 2; you can't take the value of an - <function>include</function> in PHP 3. In PHP 4, however, the - result will be: + <filename>main.html</filename>ì´ PHP3ìì ë¶ë ¤ì§ë©´, ì´ íì¼ì ë ë²ì§¸ ì¤ìì + "you can't take the value of an <function>include</function> " ë¼ë 구문 ìë¬ë¥¼ ë°ììí¨ë¤. + ê·¸ë¬ë, PHP4ììë ë¤ìë ê°ì 결과를 ì¶ë ¥íë¤. : + <screen> Before the return File returned: '27' </screen> </para> <para> - Now, assume that <filename>main.html</filename> has been altered - to contain the following: + ì´ì <filename>main.html</filename>ì ë¤ìê³¼ ê°ì ë´ì©ì¼ë¡ ê³ ì³ì ì¤íí´ ë³´ì. : <programlisting role="php"> <?php include ('test.inc'); @@ -1005,12 +950,12 @@ </programlisting> </para> <para> - In PHP 4, the output will be: + PHP4ììë ë¤ìê³¼ ê°ì ê²°ê³¼ê° ì¶ë ¥ëë¤. : <screen> Before the return Back in main.html </screen> - However, PHP 3 will give the following output: + ê·¸ë¬ë PHP3ììë ë¤ìê³¼ ê°ì ê²°ê³¼ê° ëì¨ë¤. : <screen> Before the return 27Back in main.html @@ -1019,18 +964,16 @@ </screen> </para> <para> - The above parse error is a result of the fact that the - <literal>return</literal> statement is enclosed in a non-function - block within <filename>test.inc</filename>. When the return is - moved outside of the block, the output is: + ìì 구문 ìë¬ë <filename>test.inc</filename>ìì <literal>return</literal> ë¬¸ì´ + í¨ìë¸ë¡ì´ì¸ì ë¸ë¡ìì ì¬ì©ëì기 ë문ì ì긴ë¤. + <literal>return</literal> 문ì ë¸ë¡ ë°ì¼ë¡ 꺼ë´ë©´ ë¤ìê³¼ ê°ì ê²½ê³¼ê° ì¶ë ¥ëë¤. : <screen> Before the return 27Back in main.html </screen> </para> <para> - The spurious '27' is due to the fact that PHP 3 does not support - <literal>return</literal>ing values from files like that. + ìì '27'ì´ ì¶ë ¥ë ê²ì PHP3ê° includeíì¼ë¡ ë¶í°ì ê°ì ë°íì ì§ìíì§ ì기 ë문ì´ë¤. </para> </example> <simpara>
Index: phpdoc/kr/language/control-structures.xml diff -u phpdoc/kr/language/control-structures.xml:1.3 phpdoc/kr/language/control-structures.xml:1.4 --- phpdoc/kr/language/control-structures.xml:1.3 Wed Jan 10 02:54:00 2001 +++ phpdoc/kr/language/control-structures.xml Wed Jan 10 19:35:29 2001 @@ -196,7 +196,7 @@ <literal>while</literal> </title> <para> - <literal>while</literal> 루íë PHPì ê°ì¥ ê°ë¨í ì ì´êµ¬ì¡°ì´ë¤. + <literal>while</literal> 루íë PHPì ê°ì¥ ê°ë¨í ì ì´êµ¬ì¡°ì´ë¤. ì´ê²ì Cì ëì¼íê² ìëíë¤. <literal>while</literal>ì 기본 ííë ë¤ìê³¼ ê°ë¤. : <informalexample> <programlisting> @@ -258,7 +258,7 @@ <literal>do..while</literal> </title> <simpara> - <literal>do..while</literal> 루íë ë¹êµìì´ ìì´ ìë 맨 ë¤ì ìë¤ë ì ì ì ì¸íë©´ + <literal>do..while</literal> 루íë ë¹êµìì´ ìì´ ìë 맨 ë¤ì ìë¤ë ì ì ì ì¸íë©´ <literal>while</literal> 루íì ë¹ì·íë¤. The main difference from regular <literal>while</literal> loops is that the first iteration of a <literal>do..while</literal> loop is @@ -325,7 +325,7 @@ <literal>for</literal> </title> <para> - <literal>for</literal> 루íë PHPìì ê°ì¥ ë³µì¡í 루íì´ë¤. + <literal>for</literal> 루íë PHPìì ê°ì¥ ë³µì¡í 루íì´ë¤. ì´ê²ì ííì Cì ë§¤ì° ì ì¬íë¤. <literal>for</literal> 루íì 문ë²ì ë¤ìê³¼ ê°ë¤. : <informalexample> <programlisting> @@ -348,7 +348,8 @@ ê° íê°ìì ë¹ìë ì ìë¤. <replaceable>expr2</replaceable>ê° ë¹ì´ìì¼ë©´ 무í 루í를 ë»íë¤. (PHPë Cì ê°ì´ ë¹ì´ìì¼ë©´ TRUEë¡ ì¸ìíë¤.) ì´ê±´ ë³ë¡ ì¢ì ë°©ë²ì´ ìëì§ë§, ì¢ ì¢ ì´ë ê² ì¬ì©íê³ <link linkend="control-structures.break"> - <literal>break</literal></link>를 ì¬ì©íì¬ ì¢ ë£íë ë°©ë²ë ìë¤. + <literal>break</literal> + </link>를 ì¬ì©íì¬ ì¢ ë£íë ë°©ë²ë ìë¤. </simpara> <para> ë¤ì ìë 1ìì 10ê¹ì§ ì¶ë ¥íë ìì ë¤ì´ë¤. : @@ -434,7 +435,7 @@ <para> <note> <para> - <literal>foreach</literal> ë¬¸ì´ ì²ì ìíë ë, ë´ë¶ ë°°ì´ í¬ì¸í°(internal array pointer)ë + <literal>foreach</literal> ë¬¸ì´ ì²ì ìíë ë, ë´ë¶ ë°°ì´ í¬ì¸í°(internal array pointer)ë ìëì ì¼ë¡ ë°°ì´ì 첫ë²ì§¸ ììë¡ ì¤ì ëë¤. ì´ë§ì ì미ë ì¬ë¬ë¶ì´ <literal>foreach</literal>문ì ì¬ì©í ë <function>reset</function>ì 미리 í¸ì¶í íìë ìë¤ë ê²ì´ë¤. </para> @@ -520,12 +521,12 @@ <literal>break</literal> </title> <simpara> - <literal>break</literal>ë <literal>for</literal>ë, <literal>while</literal>, <literal>switch</literal>ìì ë¹ ì ¸ ëê°ë ëª ë ¹ì´ë¤. + <literal>break</literal>ë <literal>for</literal>ë, <literal>while</literal>, + <literal>switch</literal>ìì ë¹ ì ¸ ëê°ë ëª ë ¹ì´ë¤. </simpara> <simpara> - <literal>break</literal> accepts an optional numeric argument - which tells it how many nested enclosing structures are to be - broken out of. + <literal>break</literal>ìë ì«ì ìµì ì ì¤ ì ìëë°, + ì´ê²ì íë²ì ë¹ ì ¸ ëê° ì ì´ êµ¬ì¡°ì ì를 ì미íë¤. </simpara> <para> <informalexample> @@ -562,14 +563,11 @@ <literal>continue</literal> </title> <simpara> - <literal>continue</literal> is used within looping structures to - skip the rest of the current loop iteration and continue execution - at the beginning of the next iteration. + <literal>continue</literal> ë íì¬ ë£¨íì ì²ìì¼ë¡ ê°ëë¡ íë ëª ë ¹ì´ë¤. </simpara> <simpara> - <literal>continue</literal> accepts an optional numeric argument - which tells it how many levels of enclosing loops it should skip - to the end of. + <literal>continue</literal>ë ì«ì ìµì ì ì¤ ì ìëë°, + ì´ê²ë <literal>break</literal>ììì ê°ì´ íë²ì ì²ìì¼ë¡ ê° ì ì´ êµ¬ì¡°ì ì를 ì미íë¤. </simpara> <para> <informalexample> @@ -603,18 +601,14 @@ <literal>switch</literal> </title> <simpara> - The <literal>switch</literal> statement is similar to a series of - IF statements on the same expression. In many occasions, you may - want to compare the same variable (or expression) with many - different values, and execute a different piece of code depending - on which value it equals to. This is exactly what the - <literal>switch</literal> statement is for. + <literal>switch</literal>문ì ë´ì©ì ëì¼í ííìì IF문ì ëì´í ê²ê³¼ ë¹ì·íë¤. + ë§ì ê²½ì°ì í ë³ì를 ì¬ë¬ ë¤ë¥¸ ê°ê³¼ ë¹êµíì¬, + ëê°ì ê°ì´ ê°ëëì ë°ë¼ ìë¡ ë¤ë¥¸ ì½ëë¤ì´ ìíë기를 ìíë ëê° ìë¤. + ë°ë¡ ì´ë° ê²½ì°ì <literal>switch</literal>ë¬¸ì´ ì¬ì©ëë¤. </simpara> <para> - The following two examples are two different ways to write the - same thing, one using a series of <literal>if</literal> - statements, and the other using the <literal>switch</literal> - statement: + ë¤ìì ëì¼í 결과를 ê°ì ¸ì¤ë ì를 ê°ê° <literal>if</literal>문과 + <literal>switch</literal>문ì¼ë¡ ííí ê²ì´ë¤. : <informalexample> <programlisting role="php"> if ($i == 0) { @@ -642,19 +636,11 @@ </informalexample> </para> <para> - It is important to understand how the <literal>switch</literal> - statement is executed in order to avoid mistakes. The - <literal>switch</literal> statement executes line by line - (actually, statement by statement). In the beginning, no code is - executed. Only when a <literal>case</literal> statement is found - with a value that matches the value of the - <literal>switch</literal> expression does PHP begin to execute the - statements. PHP continues to execute the statements until the end - of the <literal>switch</literal> block, or the first time it sees - a <literal>break</literal> statement. If you don't write a - <literal>break</literal> statement at the end of a case's - statement list, PHP will go on executing the statements of the - following case. For example: + <literal>switch</literal>문ì ë¬¸ì¥ ë¨ìë¡ ì¤íëë¤. + <literal>switch</literal>ì ìë íê°ìê³¼ ì¼ì¹íë <literal>case</literal>문ì ì°¾ì + ê·¸ ì´íë¶í° <literal>switch</literal> ë¸ëì´ ëë ëì 모ë 문ì¥ì ì¤ííë¤. + ë°ë¼ì ìíë ê²½ì° <literal>break</literal>ë¡ ì¤íì ì¤ì§ìí¬ íìê° ìë¤. + ë¤ì ì를 ë³´ì. : <informalexample> <programlisting role="php"> switch ($i) { @@ -669,13 +655,10 @@ </informalexample> </para> <simpara> - Here, if $i equals to 0, PHP would execute all of the print - statements! If $i equals to 1, PHP would execute the last two - print statements, and only if $i equals to 2, you'd get the - 'expected' behavior and only 'i equals 2' would be displayed. So, - it's important not to forget <literal>break</literal> statements - (even though you may want to avoid supplying them on purpose under - certain circumstances). + ì¬ê¸°ì $iê° 0ì´ë©´ 모ë print문ì ì¤íí ê²ì´ë¤. + ë§ì½ $iê° 1ì´ë©´ ë§ì§ë§ ëê°ì print문ì ì¤ííë¤. + ë°ë¼ì ê°ê°ì ê²½ì°ì íëì print 문ë§ì´ ì¤íë기를 ìíë¤ë©´, + <literal>break</literal>문ì ìì§ ììì¼íë¤. </simpara> <simpara> In a <literal>switch</literal> statement, the condition is @@ -703,8 +686,8 @@ </informalexample> </para> <para> - A special case is the default case. This case matches anything - that wasn't matched by the other cases. For example: + í¹ë³í caseë¡ default caseê° ìë¤. + ì´ê²ì ë¤ë¥¸ ì´ë¤ caseìë ë§ì§ ìë ê²½ì°ë¥¼ ì미íë¤. ì를 ë¤ì´ : <informalexample> <programlisting role="php"> switch ($i) { @@ -724,15 +707,13 @@ </informalexample> </para> <para> - The <literal>case</literal> expression may be any expression that - evaluates to a simple type, that is, integer or floating-point - numbers and strings. Arrays or objects cannot be used here unless - they are dereferenced to a simple type. + ë¤ë¥¸ ì¤ìí ì ì <literal>case</literal> ííììë ì ì, ì¤ì, 문ìì´ê°ì + ì¤ì¹¼ë¦¬ íì ì¼ë¡ íê°ëë ì´ë¤ ííìì´ìë ëë¤ë ê²ì´ë¤. + ë°°ì´ì´ë ê°ì²´ë ì¤ì¹¼ë¦¬ íì ì¼ë¡ ë³íìì¼ ì¬ì©íì§ ìë í ì¬ì©í ì ìë¤. </para> <para> - The alternative syntax for control structures is supported with - switches. For more information, see <link linkend="control-structures.alternative-syntax">Alternative syntax - for control structures</link> . + switch 문ì ëí´ìë Alternative syntaxê° ì§ìëë¤. ìì¸í ë´ì©ì + <link linkend="control-structures.alternative-syntax">Alternative syntax for control structures</link>를 ì´í´ë³´ì <informalexample> <programlisting role="php"> switch ($i): @@ -757,56 +738,43 @@ <function>require</function> </title> <simpara> - The <function>require</function> statement replaces itself with - the specified file, much like the C preprocessor's - <literal>#include</literal> works. + <function>require</function> 문ì C preprocessorì <literal>#include</literal>ì ë¹ì·íê², + ìì ì ì§ì ë íì¼ë¡ ëì²´íë¤. </simpara> <simpara> - If "URL fopen wrappers" are enabled in PHP (which they are in the - default configuration), you can specify the file to be - <function>require</function>ed using an URL instead of a local - pathname. See <link linkend="features.remote-files">Remote - files</link> and <function>fopen</function> for more information. + PHPìì "URL fopen wrappers"ê° enabledëì´ ìì¼ë©´ (기본ê°ì enabledì´ë¤.), + <function>require</function>ë í¨ìë¡ ì¼ë° íì¼ ë¿ ìëë¼ URLë ì¬ì©í ì ìë¤. + ìì¸í ë´ì©ì <link linkend="features.remote-files">Remote files</link>ì + <function>fopen</function>ì ì´í´ë³´ê¸° ë°ëë¤. + </simpara> + <simpara> + <function>include</function> ëê±°ë <function>require</function> ëì´ ì½íì§ë íì¼ì + í¬í¨ë íì¼ì ì²ìì PHP모ëìì ë¹ ì ¸ëì HTML모ëë¡ ë¤ì´ê°ê³ , ë§ì§ë§ì PHP모ëë¡ ë³µê·íë¤. + ë°ë¼ì í¬í¨ë íì¼ì PHP ì½ëë <link linkend="language.basic-syntax.phpmode">ì ì í PHP ìì, + ì¢ ë£ í</link>ì ëë¬ì¸ì¬ ìì´ì¼ íë¤. </simpara> <simpara> - An important note about how this works is that when a file is - <function>include</function>ed or <function>require</function>ed, - parsing drops out of PHP mode and into HTML mode at the beginning - of the target file, and resumes PHP mode again at the end. For - this reason, any code inside the target file which should be - executed as PHP code must be enclosed within <link linkend="language.basic-syntax.phpmode">valid PHP start and end - tags</link>. - </simpara> - <simpara> - <function>require</function> is not actually a function in PHP; - rather, it is a language construct. It is subject to some - different rules than functions are. For instance, - <function>require</function> is not subject to any containing - control structures. For another, it does not return any value; - attempting to read a return value from a - <function>require</function> call results in a parse error. - </simpara> - <simpara> - Unlike <function>include</function>, <function>require</function> - will <emphasis>always</emphasis> read in the target file, - <emphasis>even if the line it's on never executes</emphasis>. If - you want to conditionally include a file, use - <function>include</function>. The conditional statement won't - affect the <function>require</function>. However, if the line on - which the <function>require</function> occurs is not executed, - neither will any of the code in the target file be executed. - </simpara> - <simpara> - Similarly, looping structures do not affect the behaviour of - <function>require</function>. Although the code contained in the - target file is still subject to the loop, the - <function>require</function> itself happens only once. - </simpara> - <para> - This means that you can't put a <function>require</function> - statement inside of a loop structure and expect it to include the - contents of a different file on each iteration. To do that, use an - <function>include</function> statement. + <function>require</function>ë í¨ìê° ìëë¼ ì ì´êµ¬ì¡°ì´ë¤. + ë°ë¼ì ë¹ì°í í¨ììë ë¤ë¥¸ ê·ì¹ì ë°ë¥¸ë¤. + ì´ë¥¼í ë©´ <function>require</function>ë ë¤ë¥¸ ì´ë¤ ì ì´êµ¬ì¡°ìë í¨ê»ì¬ì©í ì ìë¤. + ëí, ì´ê²ì ë°íê°ì´ ìë¤. (ë°íê°ì ëë ¤ë°ì¼ë ¤íë©´ ë¬¸ë² ìë¬ê° ëë¤.) + </simpara> + <simpara> + <function>include</function>ì ë¤ë¥´ê², <function>require</function>ë ì¸ì ë í´ë¹ íì¼ì ì½ì´ì¨ë¤. + <emphasis>ì¬ì§ì´ í´ë¹ ë¼ì¸ì´ ì í ì¤íëì§ ììë ì½ì´ì¨ë¤.</emphasis> + ë§ì½ ì¡°ê±´ì ë°ë¼ íì¼ì í¬í¨ìí¤ê³ ì¶ë¤ë©´ <function>include</function>문ì ì¬ì©íì¬ì¼ íë¤. + ì¡°ê±´ì ì <function>require</function>문ì ì무 ìí¥ì 미ì¹ì§ 못íë¤. + ê·¸ë¬ë, <function>require</function>ë¬¸ì´ ìë ì¤ì´ ì¤íëì§ ìì¼ë©´ ì½ì´ì¨ íì¼ì ì´ë¤ ì½ëë ì¤íëì§ë ìëë¤. + </simpara> + <simpara> + ë§ì°¬ê°ì§ë¡, ìí문ë <function>require</function>문ì ìí¥ì ì£¼ì§ ëª»íë¤. + í¬í¨ë íì¼ì ì½ëê° ë£¨íì ì ì©ì ë°ê¸°ë íì§ë§, + <function>require</function> ëì ìì²´ë ë¨ì§ íë²ë§ ì¼ì´ëë ê²ì´ë¤. + </simpara> + <para> + ì´ê²ì 매 ìíìë§ë¤ ë¤ë¥¸ íì¼ì ì½ì´ì¤ë ¤ íë¤ë©´ + ìí문 ìì <function>require</function> 문ì ì¬ì©í´ìë ìëë¤ë ê²ì ì미íë¤. + ì´ë° ê²½ì°ìë <function>include</function>문ì ì¬ì©íì¬ì¼ íë¤ë ê²ì´ë¤. <informalexample> <programlisting role="php"> require ('header.inc'); @@ -857,13 +825,10 @@ </informalexample> </para> <simpara> - In PHP 3, it is possible to execute a <literal>return</literal> - statement inside a <function>require</function>ed file, as long as - that statement occurs in the global scope of the - <function>require</function>ed file. It may not occur within any - block (meaning inside braces ({}). In PHP 4, however, this ability - has been discontinued. If you need this functionality, see - <function>include</function>. + PHP3ììë <function>require</function>ë¡ í¬í¨ë íì¼ììì <literal>return</literal> 문ì ì¬ì©í ì ììë¤. + ë¨, return ë¬¸ì´ í¬í¨ë íì¼ì global scopeììë§ ê°ë¥íê³ , ì´ë í ë¸ë¡ë´({} ë´ë¶)ììë ì¬ì©í ì ìë¤. + ê·¸ë¬ë, PHP4ììë ì´ë° ê¸°ë¥ ìì²´ê° ìì´ì ¸ ë²ë ¸ë¤. + ë§ì½ ì¬ë¬ë¶ì´ ì´ë° 기ë¥ì ì¬ì©íê³ ì¶ë¤ë©´ <function>include</function>문ì ì¬ì©í기 ë°ëë¤. </simpara> <simpara> See also <function>include</function>, <function>require_once</function>, @@ -876,8 +841,7 @@ <function>include</function> </title> <simpara> - The <function>include</function> statement includes and evaluates - the specified file. + <function>include</function>문ì ì§ì í íì¼ì ì½ê³ ì¤ííë¤. </simpara> <simpara> If "URL fopen wrappers" are enabled in PHP (which they are in the @@ -887,19 +851,14 @@ files</link> and <function>fopen</function> for more information. </simpara> <simpara> - An important note about how this works is that when a file is - <function>include</function>ed or <function>require</function>ed, - parsing drops out of PHP mode and into HTML mode at the beginning - of the target file, and resumes again at the end. For this reason, - any code inside the target file which should be executed as PHP - code must be enclosed within <link linkend="language.basic-syntax.phpmode">valid PHP start and end - tags</link>. + <function>include</function>ëê±°ë <function>require</function> ëì´ ì½íì§ë íì¼ì + í¬í¨ë íì¼ì ì²ìì PHP모ëìì ë¹ ì ¸ëì HTML모ëë¡ ë¤ì´ê°ê³ , ë§ì§ë§ì PHP모ëë¡ ë³µê·íë¤. + ë°ë¼ì í¬í¨ë íì¼ì PHP ì½ëë <link linkend="language.basic-syntax.phpmode">ì ì í PHP ìì, ì¢ ë£ í</link>ì + ëë¬ì¸ì¬ ìì´ì¼ íë¤. </simpara> <para> - This happens each time the <function>include</function> statement - is encountered, so you can use an <function>include</function> - statement within a looping structure to include a number of - different files. + í´ë¹ íì¼ì ì½ì´ë¤ì´ë ëìì ì¤íì¤ <function>include</function> 문ì ë§ë ë ë§ë¤ ì¼ì´ëë¤. + ë°ë¼ì <function>include</function> 문ì 루í 구조 ìì ëì´ ë§¤ë² ë¤ë¥¸ íì¼ì ì½ì´ ë¤ì´ëë¡ í ì ìë¤. <informalexample> <programlisting role="php"> $files = array ('first.inc', 'second.inc', 'third.inc'); @@ -910,19 +869,14 @@ </informalexample> </para> <para> - <function>include</function> differs from - <function>require</function> in that the include statement is - re-evaluated each time it is encountered (and only when it is - being executed), whereas the <function>require</function> - statement is replaced by the required file when it is first - encountered, whether the contents of the file will be evaluated or - not (for example, if it is inside an <link linkend="control-structures.if">if</link> statement whose - condition evaluated to false). + <function>include</function>ë ì´ ë¬¸ì¥ì ë§ë ë ë§ë¤ ë§¤ë² ìë¡ ì½ì´ë¤ì´ê³ ì¤íëë¤ë ì ìì + <function>require</function>ì ë¤ë¥´ë¤. ë°ë©´ì require()문ì ì§ì ë íì¼ì ë´ì©ì´ ì¤íëëê°ì ê´ê³ìì´ + (ì를ë¤ì´ <link linkend="control-structures.if">if</link> 문 ìì ë¤ì´ìê³ ìíê° ê±°ì§ì¸ ê²½ì°ìë), + ì´ ë¬¸ì¥ì ì²ì ë§ë¬ì ë ì§ì ë íì¼ë¡ ëì²´ëë¤. </para> <para> - Because <function>include</function> is a special language - construct, you must enclose it within a statement block if it is - inside a conditional block. + <function>include</function>ë í¹ë³í 구조ì´ë¯ë¡, ë§ì½ ì´ê²ì´ ì¡°ì ì ìì ëì¬ìë¤ë©´ + ë°ëì {}(statement block)ì¼ë¡ ëë¬ì¸ì¼ íë¤. <informalexample> <programlisting role="php"> /* This is WRONG and will not work as desired. */ @@ -943,27 +897,20 @@ </informalexample> </para> <simpara> - In both PHP 3 and PHP 4, it is possible to execute a - <literal>return</literal> statement inside an - <function>include</function>ed file, in order to terminate - processing in that file and return to the script which called - it. Some differences in the way this works exist, however. The - first is that in PHP 3, the <literal>return</literal> may not - appear inside a block unless it's a function block, in which case - the <literal>return</literal> applies to that function and not the - whole file. In PHP 4, however, this restriction does not - exist. Also, PHP 4 allows you to return values from - <function>include</function>ed files. You can take the value of - the <function>include</function> call as you would a normal - function. This generates a parse error in PHP 3. + PHP3, PHP4 모ë <function>include</function>ë íì¼ ë´ìì, ì´ íì¼ë´ì ìíì ì¢ ë£íê³ , + ì´ íì¼ì ë¶ë¥¸ ì¤í¬ë¦½í¸ë¡ ë³µê·í기 ìí´ <literal>return</literal>문ì ì¬ì©í ì ìë¤. + ì½ê° ë¤ë¥¸ì ì´ ì기ëíë¤. ì°ì , PHP3ììë í´ë¹ ë¸ë¡ì´ í¨ìì ë¸ë¡ì´ ìëí return ë¬¸ì´ ë¸ë¡ìì ì¬ ì ìë¤. + (í¨ìì ë¸ë¡ ìì ìë ê²½ì°ë í´ë¹ í¨ììì return íë ê²ì´ì§ íì¬ íì¼ìì return íë ê²ì ìëë¤.) + ë°ëì Global scopeì ìì¹í´ì¼ íë¤. ê·¸ë¬ë, PHP4ììë ì´ ì íì´ ìë¤. + ëí PHP4ììë <function>include</function> íì¼ì <literal>return</literal>ìì 리í´ê°ì ì¬ì©í ì ìë¤. + <function>include</function>문ì ì¼ë° í¨ìì²ë¼ ì¬ì©íì¬ ë°íê°ì ë°ì ì ìë¤. + PHP3ììë ì´ë ê² ì¬ì©íë©´ 구문ìë¬ë¥¼ ë°ììí¨ë¤. </simpara> <example> <title> <function>include</function> in PHP 3 and PHP 4</title> <para> - Assume the existence of the following file (named - <filename>test.inc</filename>) in the same directory as the main - file: + ë¤ìì <filename>test.inc</filename>ë¼ë íì¼ì´ ë©ì¸ íì¼ê³¼ ëì¼í ëë í 리ì ìë¤ê³ ê°ì íë¤. : <programlisting role="php"> <?php echo "Before the return <br>\n"; @@ -975,8 +922,7 @@ </programlisting> </para> <para> - Assume that the main file (<filename>main.html</filename>) - contains the following: + <filename>main.html</filename> ì´ë¼ë ë©ì¸íì¼ì ë´ì©ì ë¤ìê³¼ ê°ë¤. : <programlisting role="php"> <?php $retval = include ('test.inc'); @@ -985,18 +931,17 @@ </programlisting> </para> <para> - When <filename>main.html</filename> is called in PHP 3, it will - generate a parse error on line 2; you can't take the value of an - <function>include</function> in PHP 3. In PHP 4, however, the - result will be: + <filename>main.html</filename>ì´ PHP3ìì ë¶ë ¤ì§ë©´, ì´ íì¼ì ë ë²ì§¸ ì¤ìì + "you can't take the value of an <function>include</function> " ë¼ë 구문 ìë¬ë¥¼ ë°ììí¨ë¤. + ê·¸ë¬ë, PHP4ììë ë¤ìë ê°ì 결과를 ì¶ë ¥íë¤. : + <screen> Before the return File returned: '27' </screen> </para> <para> - Now, assume that <filename>main.html</filename> has been altered - to contain the following: + ì´ì <filename>main.html</filename>ì ë¤ìê³¼ ê°ì ë´ì©ì¼ë¡ ê³ ì³ì ì¤íí´ ë³´ì. : <programlisting role="php"> <?php include ('test.inc'); @@ -1005,12 +950,12 @@ </programlisting> </para> <para> - In PHP 4, the output will be: + PHP4ììë ë¤ìê³¼ ê°ì ê²°ê³¼ê° ì¶ë ¥ëë¤. : <screen> Before the return Back in main.html </screen> - However, PHP 3 will give the following output: + ê·¸ë¬ë PHP3ììë ë¤ìê³¼ ê°ì ê²°ê³¼ê° ëì¨ë¤. : <screen> Before the return 27Back in main.html @@ -1019,18 +964,16 @@ </screen> </para> <para> - The above parse error is a result of the fact that the - <literal>return</literal> statement is enclosed in a non-function - block within <filename>test.inc</filename>. When the return is - moved outside of the block, the output is: + ìì 구문 ìë¬ë <filename>test.inc</filename>ìì <literal>return</literal> ë¬¸ì´ + í¨ìë¸ë¡ì´ì¸ì ë¸ë¡ìì ì¬ì©ëì기 ë문ì ì긴ë¤. + <literal>return</literal> 문ì ë¸ë¡ ë°ì¼ë¡ 꺼ë´ë©´ ë¤ìê³¼ ê°ì ê²½ê³¼ê° ì¶ë ¥ëë¤. : <screen> Before the return 27Back in main.html </screen> </para> <para> - The spurious '27' is due to the fact that PHP 3 does not support - <literal>return</literal>ing values from files like that. + ìì '27'ì´ ì¶ë ¥ë ê²ì PHP3ê° includeíì¼ë¡ ë¶í°ì ê°ì ë°íì ì§ìíì§ ì기 ë문ì´ë¤. </para> </example> <simpara>