ID: 15064 Updated by: torben Reported By: [EMAIL PROTECTED] Status: Bogus Bug Type: Feature/Change Request Operating System: Windows NT 4 PHP Version: 4.1.1 New Comment:
Check the manual; this is the way for loops work: >From page http://www.php.net/manual/en/control-structures.for.php for (expr1; expr2; expr3) statement The first expression (expr1) is evaluated (executed) once unconditionally at the beginning of the loop. In the beginning of each iteration, expr2 is evaluated. If it evaluates to TRUE, the loop continues and the nested statement(s) are executed. If it evaluates to FALSE, the execution of the loop ends. At the end of each iteration, expr3 is evaluated (executed). Hope this helps, Torben Previous Comments: ------------------------------------------------------------------------ [2002-01-16 03:05:03] [EMAIL PROTECTED] This is not bug. Most language behave as PHP does. ------------------------------------------------------------------------ [2002-01-16 03:01:03] [EMAIL PROTECTED] for ($i=1; $i==20; $i++) { echo($i); } does not work, while for ($i=1; $i>=20; $i++) { echo($i); } works fine. of course, if the first statement would work it wourld be redundant, so my questions is: is it a feature or a bug? ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=15064&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]