Bug #10529 Updated: for() error
| From: | cnewbill@php.net | Date: | Fri, 27 Apr 2001 19:23:07 +0000 |
| Subject: | Bug #10529 Updated: for() error | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-52610@lists.php.net to get a copy of this message | ||
ID: 10529
Updated by: cnewbill
Reported By: mottalli@sinectis.com.ar
Old-Status: Open
Status: Feedback
Bug Type: Unknown/Other Function
PHP Version: 4.0.4pl1
Assigned To:
Comments:
I'm not even sure that is supposed to work like that. Guys?
Why don't you use this instead?
for ($i = ord('A'); $i <= ord('Z'); $i++) {
echo chr($i)."<br>";
}
Previous Comments:
---------------------------------------------------------------------------
[2001-04-27 15:06:25] mottalli@sinectis.com.ar
Trying to make a script that showed the letters from A to Z using the following code:
for ($i = 'A'; $i <= 'Z'; $i++) {
echo "$i<br>";
}
I saw that the script outputted the first letters (A-Z) but then it started to display AA, AB, AC
[...] YZ.
Replacing the 'Z' above to 'Y' (or any other letter between B and Y) makes the
script show correctly the letters from A to that letter.
Replacing letters to lowercase and/or single quotation marks to double causes the same error.
This happened both in PHP 4.0.4pl1 under Windows and in PHP 4.0.1pl1 under Linux.
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10529&edit=2