From:             sala...@php.net
Operating system: OS X
PHP version:      5.3.2RC2
PHP Bug Type:     SPL related
Bug description:  Incorrect exception message in FilterIterator

Description:
------------
The lower bound of the offset parameter for the FilterIterator is zero (no
offset). When an offset less than zero is given, an OutOfBoundsException is
thrown, incorrectly stating, "Parameter offset must be > 0".

Reproduce code:
---------------
<?php

$ait = new ArrayIterator(array('a', 'b', 'c'));

try {
    $lit = new LimitIterator($ait, 0);
    echo "OK\n";
} catch (OutOfRangeException $e) {
    echo $e->getMessage() . "\n";
}

try {
    $lit = new LimitIterator($ait, -1);
    echo "OK\n";
} catch (OutOfRangeException $e) {
    echo $e->getMessage() . "\n";
}


Expected result:
----------------
OK
Parameter offset must be >= 0

Actual result:
--------------
OK
Parameter offset must be > 0

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

Reply via email to