Bug #71262 [Opn->Fbk]: for loop error
| From: | stas@php.net | Date: | Sat, 02 Jan 2016 02:27:52 +0000 |
| Subject: | Bug #71262 [Opn->Fbk]: for loop error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-198356@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71262&edit=1
ID: 71262
Updated by: stas@php.net
Reported by: m dot dziczkowski at prokonto dot pl
Summary: for loop error
-Status: Open
+Status: Feedback
Type: Bug
-Package: PHP Language Specification
+Package: Scripting Engine problem
Operating System: Linux
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Please provide full code, expected and actual output and explain what you mean by "not
working".
Previous Comments:
------------------------------------------------------------------------
[2016-01-02 02:21:44] m dot dziczkowski at prokonto dot pl
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 this bug report at https://bugs.php.net/bug.php?id=71262&edit=1