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

From: Date: Mon, 04 Aug 2014 07:48:51 +0000
Subject: Bug #67754 [Opn->Nab]: "for" judge A-Z error.
References: 1  Groups: php.standards 
Request: Send a blank email to standards-+get-298@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67754&edit=1 ID: 67754 Updated by: datibbaw@php.net 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] datibbaw@php.net 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

« previous php.standards (#298) next »