ID:              29077
 User updated by: oliver at burtchen dot com
 Reported By:     oliver at burtchen dot com
 Status:          Closed
 Bug Type:        Documentation problem
 PHP Version:     Irrelevant
 New Comment:

Sorry, my report was not correct.


Previous Comments:
------------------------------------------------------------------------

[2004-07-09 18:02:46] [EMAIL PROTECTED]

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

------------------------------------------------------------------------

[2004-07-09 17:51:58] oliver at burtchen dot com

Description:
------------
The while-condition for the example should be 1 and not 0.


Expected result:
----------------
Advanced C users may be familiar with a different usage of the
do..while loop, to allow stopping execution in the middle of code
blocks, by encapsulating them with do..while (1), and using the break 
statement. The following code fragment demonstrates this:

<?php
do {
   if ($i < 5) {
       echo "i is not big enough";
       break;
   }
   $i *= $factor;
   if ($i < $minimum_limit) {
       break;
   }
   echo "i is ok";

   /* process i */

} while (1);
?> 


Actual result:
--------------
Advanced C users may be familiar with a different usage of the
do..while loop, to allow stopping execution in the middle of code
blocks, by encapsulating them with do..while (0), and using the break 
statement. The following code fragment demonstrates this:

<?php
do {
   if ($i < 5) {
       echo "i is not big enough";
       break;
   }
   $i *= $factor;
   if ($i < $minimum_limit) {
       break;
   }
   echo "i is ok";

   /* process i */

} while (0);
?> 



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=29077&edit=1

Reply via email to