From:             
Operating system: Windows 7
PHP version:      5.3.8
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:range() returns array of integers when arguments are numeric 
strings

Description:
------------
Hi.
I think the 'range()' function should return an array with strings, if the
'start' and 'limit' arguments are numeric strings. Otherwise it should be
mentioned in the documentation.

Test script:
---------------
<?php
var_dump(range('0', '9'));

Expected result:
----------------
array(10) {
  [0]=> string(1) "0"
  [1]=> string(1) "1"
  [2]=> string(1) "2"
  [3]=> string(1) "3"
  [4]=> string(1) "4"
  [5]=> string(1) "5"
  [6]=> string(1) "6"
  [7]=> string(1) "7"
  [8]=> string(1) "8"
  [9]=> string(1) "9"
}

Actual result:
--------------
array(10) {
  [0]=> int(0)
  [1]=> int(1)
  [2]=> int(2)
  [3]=> int(3)
  [4]=> int(4)
  [5]=> int(5)
  [6]=> int(6)
  [7]=> int(7)
  [8]=> int(8)
  [9]=> int(9)
}

-- 
Edit bug report at https://bugs.php.net/bug.php?id=60574&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=60574&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=60574&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=60574&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=60574&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=60574&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=60574&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=60574&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=60574&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=60574&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=60574&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=60574&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=60574&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=60574&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=60574&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=60574&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=60574&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=60574&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=60574&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=60574&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=60574&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=60574&r=mysqlcfg

Reply via email to