note 80075 added to control-structures.continue

From: Date: Fri, 28 Dec 2007 01:01:07 +0000
Subject: note 80075 added to control-structures.continue
Groups: php.notes 
Request: Send a blank email to php-notes+get-134058@lists.php.net to get a copy of this message
For clarification, here are some examples of continue used in a while/do-while loop, showing that it has no effect on the conditional evaluation element. <?php // Outputs "1 ". $i = 0; while ($i == 0) { $i++; echo "$i "; if ($i == 1) continue; } // Outputs "1 2 ". $i = 0; do { $i++; echo "$i "; if ($i == 2) continue; } while ($i == 1); ?> Both code snippets would behave exactly the same without continue. ---- Server IP: 66.207.199.35 Probable Submitter: 75.152.237.160 ---- Manual Page -- http://www.php.net/manual/en/control-structures.continue.php Edit -- https://master.php.net/note/edit/80075 Del: integrated -- https://master.php.net/note/delete/80075/integrated Del: useless -- https://master.php.net/note/delete/80075/useless Del: bad code -- https://master.php.net/note/delete/80075/bad+code Del: spam -- https://master.php.net/note/delete/80075/spam Del: non-english -- https://master.php.net/note/delete/80075/non-english Del: in docs -- https://master.php.net/note/delete/80075/in+docs Del: other reasons-- https://master.php.net/note/delete/80075 Reject -- https://master.php.net/note/reject/80075 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#134058) next »