php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #51574 Modify range() function to support A to ZZZZ
Submitted: 2010-04-16 17:48 UTC Modified: -
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: phpnetmail at jeo dot net Assigned:
Status: Open Package: Arrays related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: phpnetmail at jeo dot net
New email:
PHP Version: OS:

 

 [2010-04-16 17:48 UTC] phpnetmail at jeo dot net
Description:
------------
This is a low low low priority feature request, but it would be nice if the range() function supported letters beyond just A to Z. 

For example:

echo count(range('A','ZZZZ')); 

returns 26, but in many other languages once you get to Z it continues to AA

For example in perl: 
perl -e '$_=()=A..ZZZZ;print'

you get 475254



Test script:
---------------
$a = count(range('A','ZZZZ')); 

if ($a == 475254 ) { 
  echo 'RANGE IS WORKING!'
} else { 
  echo 'RANGE STOPS AT Z. Foo. '
}

Expected result:
----------------
RANGE IS WORKING!

Actual result:
--------------
RANGE STOPS AT Z. Foo. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 10:01:26 2024 UTC