#37770 [Com]: 'For' cycle bad work
| From: | judas dot iscariote at gmail dot com | Date: | Fri, 09 Jun 2006 19:36:32 +0000 |
| Subject: | #37770 [Com]: 'For' cycle bad work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-98250@lists.php.net to get a copy of this message | ||
ID: 37770
Comment by: judas dot iscariote at gmail dot com
Reported By: sorrentino at ingv dot it
Status: Open
Bug Type: Scripting Engine problem
Operating System: Linux Slackware
PHP Version: 4.4.2
New Comment:
altough this is not a bug, because this is the expected, correct
behaviuor, the documentation do not mention this feature, and can be
confusing for newbies.
I suggest you reclassify this as a documentation problem.and read this
comment http://cl2.php.net/manual/en/control-structures.for.php#42850
to get the result you expect, also make sure to ask in a support forum
next time.
Previous Comments:
------------------------------------------------------------------------
[2006-06-09 18:51:21] sorrentino at ingv dot it
Description:
------------
cyclyng (with for and while) from 'A' to 'Z' the cycle doesn't stop to
'Z' but continue, passing from 'AA', 'till 'YZ'
ps.
the bug was submitted here too
<http://bugs.php.net/bug.php?id=15597>
on date: 18 Feb 2002
php version: 4.1.1
and is still present in php4.4.2 and in php5.2-200606091630
Reproduce code:
---------------
<?
for($i='A'; $i<='Z'; $i++)
echo $i . ", ";
?>
Expected result:
----------------
A, B, C, ..., Z
Actual result:
--------------
A, B, C, ..., Z, AA, AB, AC, ..., YW, YX, YY, YZ
i can't post a backtrace because the program exit normally, without a
crash :-(
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37770&edit=1