|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24220 String conversion to numbers in "range()"
Submitted: 2003-06-17 05:32 UTC Modified: 2003-06-17 11:21 UTC
From: minakov at bas-net dot by Assigned:
Status: Closed Package: Arrays related
PHP Version: 4.3.1 OS: WinXP
Private report: No CVE-ID: None
 [2003-06-17 05:32 UTC] minakov at bas-net dot by
I've found a bug with "range" in PHP 4.3.1;

print_r(range("2003", "2004")) != print_r(range(2003, 2004));
print_r(range("2003", "2004")) == print_r(range(2, 2));

Reproduce code:
print_r(range("2003", "2004"));

Expected result:
    [0] => 2003
    [1] => 2004

Actual result:
    [0] => 2


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-17 05:39 UTC]
This is a doc problem. From PHP 4.1.0 and higher you can also use characters as a range... and the function effectively does range("2", "2") now (it takes the first character).
 [2003-06-17 08:20 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Sep 23 19:01:25 2023 UTC