From:             ryanlewellen at comcast dot net
Operating system: Windows XP Professional
PHP version:      4.3.5RC2
PHP Bug Type:     Unknown/Other Function
Bug description:  Problem with "If statements" in "For Statemnets"

Description:
------------
When i put an IF statement inside a FOR statement, i ran into the problem
that it went into an infinite loop. However, when i took out the IF
statement, it did what i wanted it to do.

Reproduce code:
---------------
<?php
echo ("This is a FOR STATEMENT <BR>");
$counter0=0;
for ($counter0=0; $counter0<=100; $counter0++)
        {
        echo ("Pass # " . $counter0 . " is now in effect. <BR>");
        if ($counter0=50)
          {
            echo ("Only 50 more to go!");
          }
        }
?>

Expected result:
----------------
It would create 100 lines in a webpage, with increasing values, and at 50,
it would echo "Only 50 more to go!" and continue on.

Actual result:
--------------
It started at 0, jumped to 50, and ran into an infinite loop. See for
yourself.

-- 
Edit bug report at http://bugs.php.net/?id=27214&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=27214&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=27214&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=27214&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=27214&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=27214&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=27214&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=27214&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=27214&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=27214&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=27214&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=27214&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=27214&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27214&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=27214&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=27214&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=27214&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=27214&r=float

Reply via email to