|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-10-10 17:50 UTC] elmicha@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 19:00:01 2025 UTC |
Description: ------------ When trying to loop 'a' through 'z' using for ($i = 'a'; $i < 'z'; $i++) print $i; it loops a-y as it should, but when you try for ($i = 'a'; $i <= 'z'; $i++) print $i; instead of going a-z it goes a-yz doubling up the letters after a-z a-z aa-az ba-bz ca-cz ... etc I know this breaks under php5, and under php4. Reproduce code: --------------- for ($i = 'a'; $i < 'z'; ++$i) { print "$i\n"; } and for ($i = 'a'; $i <= 'z'; ++$i) { print "$i\n"; } Expected result: ---------------- abcdefghijklmnopqrstuvwxyz (seperated by new lines) Actual result: -------------- abcdefghijklmnopqrstuvwxyzaaabacadaeaf....yxyyyz