[PHP-BUG] Bug #71262 [NEW]: for loop error
[email protected] ("m dot dziczkowski at prokonto dot pl")
| Newsgroups | php.standards |
|---|---|
| Message-ID | <[email protected]> |
From: m dot dziczkowski at prokonto dot pl
Operating system: Linux
PHP version: Irrelevant
Package: PHP Language Specification
Bug Type: Bug
Bug description:for loop error
Description:
------------
I had found a bug in the for loop. Increasing value is working, but
decreasing isn't. See code
Test script:
---------------
// Working
for ($y = 1945; $y <= 2015; $y++)
{
// some code to do
}
// Not working
for ($y = 2015; $y <= 1945; $y--)
{
// some code to do
}
// sames happens if I replace (in the not working one) the "2015" with a
variable (for example: $year = 2015; or $year = date("Y");
Expected result:
----------------
displayed values from 2015 to 1945
Actual result:
--------------
none
--
Edit bug report at https://bugs.php.net/bug.php?id=71262&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71262&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71262&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71262&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71262&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71262&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71262&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71262&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71262&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71262&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71262&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71262&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71262&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71262&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71262&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71262&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71262&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71262&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71262&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71262&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71262&r=mysqlcfg