|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-08-22 15:32 UTC] ohill@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 10:00:02 2025 UTC |
Description: ------------ manual bug (up to latest rel. at 12 aug 2006) : Chapter 16. Control Structures do-while -------- a do-while example loop is shown (the man. ex. below) which should be endless by using "while (0);" where (0) indicates a false condition. note: the endless condition is used to illustrate the "break" statement to exit the loop instead. the loop will terminate at once with while(0) - the correct syntax is while (1) or while(true) to make a endless loop. Reproduce code: --------------- <?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); ?>