#33676 [NEW]: [chm] bug on control-structures.do.while.html

From: Date: Wed, 13 Jul 2005 08:32:24 +0000
Subject: #33676 [NEW]: [chm] bug on control-structures.do.while.html
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969369088@lists.php.net to get a copy of this message
From: richard dot quadling at bandvulc dot co dot uk Operating system: All PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: [chm] bug on control-structures.do.while.html Description: ------------ The do-while control structure mentions the use of break in a do-while loop, but does not say if it is supported in PHP or not. The manual reads ... "Don't worry if you don't understand this right away or at all. You can code scripts and even powerful scripts without using this 'feature'." When it says I can code without this "feature" does this mean I do not need to use this "feature", because I don't understand the "feature", or I cannot use this "feature", because this "feature" is not supported? I think the issue is that at the top of the page for do-while there is a statement ... "There is just one syntax for do-while loops:" Initially, I thought that the documentation meant that this "feature" was not available in PHP. It is available in PHP5.0.4 (as seen by the code below - cli code). Reproduce code: --------------- <?php echo "About to enter a while loop with a break.\n"; $iCount = 0; $iBreakOn = 10; while(True) { ++$iCount; echo "Counted to $iCount\n"; if ($iCount === $iBreakOn) { break; } } echo "While loop exited with $iCount.\n"; echo "About to enter a do-while loop with a break.\n"; $iCount = 0; $iBreakOn = 10; do { ++$iCount; echo "Counted to $iCount.\n"; if ($iCount === $iBreakOn) { break; } } while(True); echo "While loop exited with $iCount.\n"; ?> Actual result: -------------- About to enter a while loop with a break Counted to 1 Counted to 2 Counted to 3 Counted to 4 Counted to 5 Counted to 6 Counted to 7 Counted to 8 Counted to 9 Counted to 10 While loop exited with 10 About to enter a do-while loop with a break Counted to 1 Counted to 2 Counted to 3 Counted to 4 Counted to 5 Counted to 6 Counted to 7 Counted to 8 Counted to 9 Counted to 10 While loop exited with 10 -- Edit bug report at http://bugs.php.net/?id=33676&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33676&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33676&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33676&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=33676&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=33676&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=33676&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=33676&r=needscript Try newer version: http://bugs.php.net/fix.php?id=33676&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=33676&r=support Expected behavior: http://bugs.php.net/fix.php?id=33676&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=33676&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=33676&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=33676&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33676&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=33676&r=dst IIS Stability: http://bugs.php.net/fix.php?id=33676&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=33676&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=33676&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=33676&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=33676&r=mysqlcfg

« previous php.doc (#969369088) next »