note 111929 rejected from control-structures.for by aharvey
| From: | aharvey@php.net | Date: | Mon, 15 Apr 2013 22:20:39 +0000 |
| Subject: | note 111929 rejected from control-structures.for by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-194485@lists.php.net to get a copy of this message | ||
Note Submitter: TAB4217 at GMail dot com
----
Quote:
first expression (expr1) is evaluated (executed) once unconditionally at the beginning of the loop.
So, what use is it in the 'for' syntax? expr1 should be inserted BEFORE the loop begins,
like any other statements leading up to 'for'.
The loop syntax would become simpler, and less confusing (One logically expects an expression in any
loop to be evaluated at every iteration.), with only expr2 and expr3 --renamed, of course, expr1 and
expr2.