vrana Fri Aug 6 04:32:49 2004 EDT
Modified files: /phpdoc/en/language control-structures.xml Log: WS http://cvs.php.net/diff.php/phpdoc/en/language/control-structures.xml?r1=1.101&r2=1.102&ty=u Index: phpdoc/en/language/control-structures.xml diff -u phpdoc/en/language/control-structures.xml:1.101 phpdoc/en/language/control-structures.xml:1.102 --- phpdoc/en/language/control-structures.xml:1.101 Tue Jul 27 17:17:22 2004 +++ phpdoc/en/language/control-structures.xml Fri Aug 6 04:32:48 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.101 $ --> +<!-- $Revision: 1.102 $ --> <chapter id="language.control-structures"> <title>Control Structures</title> @@ -25,7 +25,7 @@ <programlisting> <![CDATA[ <?php - if (expression) +if (expression) statement ?> ]]> @@ -242,7 +242,8 @@ <informalexample> <programlisting> <![CDATA[ -while (expr) statement +while (expr) + statement ]]> </programlisting> </informalexample> @@ -268,7 +269,10 @@ <informalexample> <programlisting> <![CDATA[ -while (expr): statement ... endwhile; +while (expr): + statement + ... +endwhile; ]]> </programlisting> </informalexample> @@ -386,7 +390,8 @@ <informalexample> <programlisting> <![CDATA[ -for (expr1; expr2; expr3) statement +for (expr1; expr2; expr3) + statement ]]> </programlisting> </informalexample> @@ -471,7 +476,10 @@ <informalexample> <programlisting> <![CDATA[ -for (expr1; expr2; expr3): statement; ...; endfor; +for (expr1; expr2; expr3): + statement + ... +endfor; ]]> </programlisting> </informalexample> @@ -490,8 +498,10 @@ <informalexample> <programlisting> <![CDATA[ -foreach (array_expression as $value) statement -foreach (array_expression as $key => $value) statement +foreach (array_expression as $value) + statement +foreach (array_expression as $key => $value) + statement ]]> </programlisting> </informalexample> @@ -550,8 +560,8 @@ <![CDATA[ <?php $arr = array("one", "two", "three"); -reset ($arr); -while (list(, $value) = each ($arr)) { +reset($arr); +while (list(, $value) = each($arr)) { echo "Value: $value<br />\n"; } @@ -569,7 +579,7 @@ <?php $arr = array("one", "two", "three"); reset($arr); -while (list($key, $value) = each ($arr)) { +while (list($key, $value) = each($arr)) { echo "Key: $key; Value: $value<br />\n"; } @@ -663,7 +673,7 @@ <![CDATA[ <?php $arr = array('one', 'two', 'three', 'four', 'stop', 'five'); -while (list (, $val) = each ($arr)) { +while (list(, $val) = each($arr)) { if ($val == 'stop') { break; /* You could also write 'break 1;' here. */ } @@ -717,11 +727,11 @@ <programlisting role="php"> <![CDATA[ <?php -while (list ($key, $value) = each ($arr)) { +while (list($key, $value) = each($arr)) { if (!($key % 2)) { // skip odd members continue; } - do_something_odd ($value); + do_something_odd($value); } $i = 0; @@ -997,7 +1007,8 @@ <informalexample> <programlisting> <![CDATA[ -declare (directive) statement +declare (directive) + statement ]]> </programlisting> </informalexample> @@ -1071,11 +1082,11 @@ // Return the times stored in profile, then erase it if ($dump) { $temp = $profile; - unset ($profile); - return ($temp); + unset($profile); + return($temp); } - $profile[] = microtime (); + $profile[] = microtime(); } // Set up a tick handler @@ -1092,7 +1103,7 @@ } // Display the data stored in the profiler -print_r(profile (TRUE)); +print_r(profile(TRUE)); ?> ]]> </programlisting>