From 0fc913567d18e04ca2f991540928ecb745a13144 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Fri, 13 Jun 2003 11:00:03 +0000 Subject: [PATCH] - Added - + Control Structures @@ -326,7 +326,7 @@ endwhile; $i = 0; do { print $i; -} while ($i>0); +} while ($i > 0); ?> ]]> @@ -360,7 +360,7 @@ do { } print "i is ok"; - ...process i... + /* process i */ } while(0); ?> @@ -431,7 +431,7 @@ for ($i = 1; $i <= 10; $i++) { /* example 2 */ -for ($i = 1;;$i++) { +for ($i = 1; ; $i++) { if ($i > 10) { break; } @@ -543,12 +543,14 @@ foreach (array_expression as $key => $value) statement - - - foreach does not support the ability to - suppress error messages using '@'. - - + + + + foreach does not support the ability to + suppress error messages using '@'. + + + You may have noticed that the following are functionally identical: @@ -872,8 +874,8 @@ switch ($i) { - 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 default case. This case matches + anything that wasn't matched by the other cases, and should be the last case statement. For example: @@ -1089,15 +1091,17 @@ print_r (profile (TRUE)); For more information, see Returning values. - - - Note that since return is a language - construct and not a function, the parentheses surrounding its - arguments are not 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. - - + + + + Note that since return is a language + construct and not a function, the parentheses surrounding its + arguments are not 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. + + + @@ -1146,18 +1150,21 @@ require ('somefile.txt'); See the include documentation for more examples. - - - Prior to PHP 4.0.2, the following applies: require will - always attempt to read the target file, even if the line it's on never executes. - The conditional statement won't affect require. However, - if the line on which the require 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 require. Although - the code contained in the target file is still subject to the loop, the - require itself happens only once. - - + + + + Prior to PHP 4.0.2, the following applies: require + will always attempt to read the target file, even if the line it's on + never executes. The conditional statement won't affect + require. However, if the line on which the + require 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 require. Although + the code contained in the target file is still subject to the loop, the + require itself happens only once. + + + ¬e.language-construct; @@ -1237,7 +1244,7 @@ echo "A $color $fruit"; // A green apple function foo() { -global $color; + global $color; include 'vars.php'; @@ -1286,9 +1293,9 @@ echo "A $color $fruit"; // A green - See also Remote files, - fopen and file for related - information. + See also Remote files, + fopen and file for related + information. Because include and require @@ -1351,13 +1358,15 @@ if ($condition) { values from included files. You can take the value of the include call as you would a normal function. - - - In PHP 3, the return may not appear inside a block unless it's - a function block, in which case the return applies - to that function and not the whole file. - - + + + + In PHP 3, the return may not appear inside a block unless it's + a function block, in which case the return applies + to that function and not the whole file. + + + <function>include</function> and the <function>return</function> statement @@ -1413,8 +1422,7 @@ echo $bar; // prints 1 virtual, and include_path. - - + <function>require_once</function> @@ -1440,29 +1448,33 @@ echo $bar; // prints 1 PEAR code included in the latest PHP source code distributions. - - - require_once was added in PHP 4.0.1pl2 - - - - - Be aware, that the behaviour of require_once - and include_once may not be what you expect - on a non case sensitive operating system (such as Windows). - - <function>require_once</function> is case sensitive - + + + + require_once was added in PHP 4.0.1pl2 + + + + + + + Be aware, that the behaviour of require_once + and include_once may not be what you expect + on a non case sensitive operating system (such as Windows). + + <function>require_once</function> is case sensitive + ]]> - - - - + + + + + &warn.no-win32-fopen-wrapper; See also: require, @@ -1491,34 +1503,38 @@ require_once("A.php"); // this will include a.php again on Windows! variable value reassignments, etc. - For more examples on using require_once and - include_once, look at the - PEAR code included in the latest - PHP source code distributions. + For more examples on using require_once and + include_once, look at the + PEAR code included in the latest + PHP source code distributions. + + + + include_once was added in PHP 4.0.1pl2 + + + + - - include_once was added in PHP 4.0.1pl2 - - - - - Be aware, that the behaviour of include_once - and require_once may not be what you expect - on a non case sensitive operating system (such as Windows). - - <function>include_once</function> is case sensitive - + + Be aware, that the behaviour of include_once + and require_once may not be what you expect + on a non case sensitive operating system (such as Windows). + + <function>include_once</function> is case sensitive + ]]> - - - - + + + + + &warn.no-win32-fopen-wrapper; See also include,