#42949 [Com]: range('a', 'Z') has weird results

From: Date: Fri, 12 Oct 2007 16:17:41 +0000
Subject: #42949 [Com]: range('a', 'Z') has weird results
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-118478@lists.php.net to get a copy of this message
ID: 42949 Comment by: felipensp at gmail dot com Reported By: phpbug at fint dot org Status: Open Bug Type: Arrays related Operating System: Linux PHP Version: 5.2.4 New Comment: The order is A-Z, a-z. <?php $init = ord('A'); $end = ord('z'); printf("Init.: %d | End.: %d\n", $init, $end); for ($i = $init; $i <= $end; $i++) { print chr($i); } print "\n"; ?> Previous Comments: ------------------------------------------------------------------------ [2007-10-12 13:49:56] phpbug at fint dot org Description: ------------ range('a', 'Z') gives random junk Reproduce code: --------------- <?php foreach (range('a', 'Z') as $letter) { echo $letter; } ?> Expected result: ---------------- a-z and A-Z (wishful thinking?) I am trying to recreate Perl's "@a=('a'..'z', 'A'..'Z');" Actual result: -------------- a`_^]\[Z ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42949&edit=1

« previous php.bugs (#118478) next »