Bug #67754 [Opn->Nab]: "for" judge A-Z error.

[email protected]
Newsgroups php.standards
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=67754&edit=1

 ID:                 67754
 Updated by:         [email protected]
 Reported by:        yppah56 at yahoo dot com dot tw
 Summary:            "for" judge A-Z error.
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            PHP Language Specification
 Operating System:   Linux(Ubuntu13.4)
 PHP Version:        5.4.31
 Block user comment: N
 Private report:     N

 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




Previous Comments:
------------------------------------------------------------------------
[2014-08-04 07:48:37] [email protected]

This happens because after 'Z' comes 'AA', and 'AA' is smaller than 'Z'.

The correct condition in this case is:

    $char != 'AA'

The other way (recommended):

    foreach (range('A', 'Z') as $char) {
    }

------------------------------------------------------------------------
[2014-08-04 07:36:25] yppah56 at yahoo dot com dot tw

Description:
------------
0000
When for() judge 'Z', find error.

  for ($char='A'; $char<='Z'; $char++) echo $char;

Echo not as expected.
Maybe counting error.


Test script:
---------------
// this program is OK
for ($char='A'; $char<='Y'; $char++) {
  echo $char;
}


// this program is Error
for ($char='A'; $char<='Z'; $char++) {
  echo $char;
}



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=67754&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.