Bug #66793 [NEW]: range(0,9) and range('0','9') both produce intergers in array
From: araustin at gmail dot com
Operating system: Win 8
PHP version: 5.4.25
Package: Output Control
Bug Type: Bug
Bug description:range(0,9) and range('0','9') both produce intergers in array
Description:
------------
---
From manual page: http://www.php.net/function.range
---
Test script:
---------------
$allowedChars_num = range(0,9);
$allowedChars_str = range('0','9');
var_dump($allowedChars_num);
var_dump($allowedChars_str);
Expected result:
----------------
range(0,9) is proper, making an array of integers
range('0','9') should be making an array of strings, ex:
'0','1','2'
etc...
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)
}
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=66793&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66793&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66793&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66793&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66793&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66793&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66793&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66793&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66793&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66793&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66793&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66793&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66793&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66793&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66793&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66793&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66793&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66793&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66793&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66793&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66793&r=mysqlcfg
Thread (4 messages)
- araustin at gmail dot com