From:             oistein dot notnas at mtu dot no
Operating system: Windows XP
PHP version:      5.2.6
PHP Bug Type:     Feature/Change Request
Bug description:  range() should return low value even if low + step > high

Description:
------------
If the start value is lower then the max value, you should get one result
even if the step makes it unable to return 2 values. 

Instead of 
$list = range($i * 2, TOP, $i);

I have to write
if (TOP > ($i * 3))
        $list = range($i * 2, TOP, $i);
    else 
        $list = array($i * 2);

could not even use
$list = @range($i * 2, TOP, $i) or array($i * 2);

Reproduce code:
---------------
print_r(range(6, 8, 3));

Expected result:
----------------
Array
(
    [0] => 6
)

Actual result:
--------------
Warning: range(): step exceeds the specified range

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

Reply via email to