derick Fri Jun 13 07:00:04 2003 EDT Modified files: /phpdoc/en/language control-structures.xml Log: - Added <?php tags, always use para/note/(sim)para
Index: phpdoc/en/language/control-structures.xml diff -u phpdoc/en/language/control-structures.xml:1.77 phpdoc/en/language/control-structures.xml:1.78 --- phpdoc/en/language/control-structures.xml:1.77 Mon Jun 9 15:28:28 2003 +++ phpdoc/en/language/control-structures.xml Fri Jun 13 07:00:03 2003 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.77 $ --> +<!-- $Revision: 1.78 $ --> <chapter id="control-structures"> <title>Control Structures</title> @@ -326,7 +326,7 @@ $i = 0; do { print $i; -} while ($i>0); +} while ($i > 0); ?> ]]> </programlisting> @@ -360,7 +360,7 @@ } print "i is ok"; - ...process i... + /* process i */ } while(0); ?> @@ -431,7 +431,7 @@ /* example 2 */ -for ($i = 1;;$i++) { +for ($i = 1; ; $i++) { if ($i > 10) { break; } @@ -543,12 +543,14 @@ </para> </note> </para> - <note> - <para> - <literal>foreach</literal> does not support the ability to - suppress error messages using '@'. - </para> - </note> + <para> + <note> + <para> + <literal>foreach</literal> does not support the ability to + suppress error messages using '@'. + </para> + </note> + </para> <para> You may have noticed that the following are functionally identical: @@ -872,8 +874,8 @@ </informalexample> </para> <para> - A special case is the default case. This case matches anything - that wasn't matched by the other cases, and should be the last + A special case is the <literal>default</literal> case. This case matches + anything that wasn't matched by the other cases, and should be the last <literal>case</literal> statement. For example: <informalexample> <programlisting role="php"> @@ -1089,15 +1091,17 @@ <simpara>For more information, see <link linkend="functions.returning-values">Returning values</link>. </simpara> - <note> - <simpara> - Note that since <function>return</function> is a language - construct and not a function, the parentheses surrounding its - arguments are <emphasis>not</emphasis> required--in fact, it is - more common to leave them out than to use them, although it - doesn't matter one way or the other. - </simpara> - </note> + <para> + <note> + <simpara> + Note that since <function>return</function> is a language + construct and not a function, the parentheses surrounding its + arguments are <emphasis>not</emphasis> required--in fact, it is + more common to leave them out than to use them, although it + doesn't matter one way or the other. + </simpara> + </note> + </para> </sect1> @@ -1146,18 +1150,21 @@ <simpara> See the <function>include</function> documentation for more examples. </simpara> - <note> - <simpara> - Prior to PHP 4.0.2, the following applies: <function>require</function> will - always attempt to read the target file, even if the line it's on never executes. - The conditional statement won't affect <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. 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> - </note> + <para> + <note> + <simpara> + Prior to PHP 4.0.2, the following applies: <function>require</function> + will always attempt to read the target file, even if the line it's on + never executes. The conditional statement won't affect + <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. 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> + </note> + </para> ¬e.language-construct; @@ -1237,7 +1244,7 @@ function foo() { -global $color; + global $color; include 'vars.php'; @@ -1286,9 +1293,9 @@ <![CDATA[ <?php -/* This example assumes that www.example.com is configured to parse .php * - * files and not .txt files. Also, 'Works' here means that the variables * - * $foo and $bar are available within the included file. */ +/* This example assumes that www.example.com is configured to parse .php + * files and not .txt files. Also, 'Works' here means that the variables + * $foo and $bar are available within the included file. */ // Won't work; file.txt wasn't handled by www.example.com as PHP include 'http://www.example.com/file.txt?foo=1&bar=2'; @@ -1309,9 +1316,9 @@ ]]> </programlisting> </example> - See also <link linkend="features.remote-files">Remote files</link>, - <function>fopen</function> and <function>file</function> for related - information. + See also <link linkend="features.remote-files">Remote files</link>, + <function>fopen</function> and <function>file</function> for related + information. </para> <para> Because <function>include</function> and <function>require</function> @@ -1351,13 +1358,15 @@ values from included files. You can take the value of the include call as you would a normal function. </simpara> - <note> - <simpara> - In PHP 3, the return may not appear inside a block unless it's - a function block, in which case the <function>return</function> applies - to that function and not the whole file. - </simpara> - </note> + <para> + <note> + <simpara> + In PHP 3, the return may not appear inside a block unless it's + a function block, in which case the <function>return</function> applies + to that function and not the whole file. + </simpara> + </note> + </para> <para> <example> <title><function>include</function> and the <function>return</function> statement</title> @@ -1413,8 +1422,7 @@ <function>virtual</function>, and <link linkend="ini.include-path">include_path</link>. </simpara> - -</sect1> + </sect1> <sect1 id="function.require-once"> <title><function>require_once</function></title> @@ -1440,29 +1448,33 @@ <ulink url="&url.php.pear;">PEAR</ulink> code included in the latest PHP source code distributions. </para> - <note> - <para> - <function>require_once</function> was added in PHP 4.0.1pl2 - </para> - </note> - <note> - <para> - Be aware, that the behaviour of <function>require_once</function> - and <function>include_once</function> may not be what you expect - on a non case sensitive operating system (such as Windows). - <example> - <title><function>require_once</function> is case sensitive</title> - <programlisting role="php"> + <para> + <note> + <para> + <function>require_once</function> was added in PHP 4.0.1pl2 + </para> + </note> + </para> + <para> + <note> + <para> + Be aware, that the behaviour of <function>require_once</function> + and <function>include_once</function> may not be what you expect + on a non case sensitive operating system (such as Windows). + <example> + <title><function>require_once</function> is case sensitive</title> + <programlisting role="php"> <![CDATA[ <?php require_once("a.php"); // this will include a.php require_once("A.php"); // this will include a.php again on Windows! ?> ]]> - </programlisting> - </example> - </para> - </note> + </programlisting> + </example> + </para> + </note> + </para> &warn.no-win32-fopen-wrapper; <para> See also: <function>require</function>, @@ -1491,34 +1503,38 @@ variable value reassignments, etc. </para> <para> - For more examples on using <function>require_once</function> and - <function>include_once</function>, look at the - <ulink url="&url.php.pear;">PEAR</ulink> code included in the latest - PHP source code distributions. + For more examples on using <function>require_once</function> and + <function>include_once</function>, look at the + <ulink url="&url.php.pear;">PEAR</ulink> code included in the latest + PHP source code distributions. </para> + <para> + <note> + <para> + <function>include_once</function> was added in PHP 4.0.1pl2 + </para> + </note> + </para> + <para> <note> - <para> - <function>include_once</function> was added in PHP 4.0.1pl2 - </para> - </note> - <note> - <para> - Be aware, that the behaviour of <function>include_once</function> - and <function>require_once</function> may not be what you expect - on a non case sensitive operating system (such as Windows). - <example> - <title><function>include_once</function> is case sensitive</title> - <programlisting role="php"> + <para> + Be aware, that the behaviour of <function>include_once</function> + and <function>require_once</function> may not be what you expect + on a non case sensitive operating system (such as Windows). + <example> + <title><function>include_once</function> is case sensitive</title> + <programlisting role="php"> <![CDATA[ <?php include_once("a.php"); // this will include a.php include_once("A.php"); // this will include a.php again on Windows! ?> ]]> - </programlisting> - </example> - </para> - </note> + </programlisting> + </example> + </para> + </note> + </para> &warn.no-win32-fopen-wrapper; <para> See also <function>include</function>,
-- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php