note 46574 deleted from control-structures.for by danbrown
| From: | danbrown@php.net | Date: | Mon, 07 Dec 2009 16:07:17 +0000 |
| Subject: | note 46574 deleted from control-structures.for by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-163659@lists.php.net to get a copy of this message | ||
Note Submitter: jphansen at uga dot edu
----
as harbater at teamgenesis dot com noted, don't use a comma to separate conditions in expr2.
But if you do, the result will be ONLY the last condition being evaluated for the continuation of
the loop. So this would iterate infinitely: for(; false, true;); and if you swapped the true and
false it would break immediately.
I wouldn't count using a comma completely out of the question, since there may be a rare
circumstance where you would only want to break if the last evaluation returns false.