Bug #62477 [NEW]: Problem LimitIterator , argument Offset only Integers
| From: | tuadmin at gmail dot com | Date: | Wed, 04 Jul 2012 04:41:45 +0000 |
| Subject: | Bug #62477 [NEW]: Problem LimitIterator , argument Offset only Integers | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-171728@lists.php.net to get a copy of this message | ||
From: tuadmin at gmail dot com
Operating system: windows XP SP3
PHP version: 5.3.14
Package: SPL related
Bug Type: Bug
Bug description:Problem LimitIterator , argument Offset only Integers
Description:
------------
---
From manual page: http://www.php.net/class.limititerator
---
The LimitIterator error is given by the offset argument as INTEGER and not
only allows FLOATS
--spanish--
El error de limitIterator es dado por el argumento de OFFSET ya que solo
permite ENTEROS y no FLOATS
Test script:
---------------
/**
* @author tuadmin
* @version 1.0.0
*/
class combinator implements SeekableIterator
{
private $_n = 0;//float val
public function next(){$this->_n++;}
public function rewind(){$this->_n = 0;}
public function current(){ return $this->_n;}
public function key(){}
public function valid(){return $this->_n < 10000000000000000000;}
public function seek($pos){$this->_n = $pos;}
}
$comb = new combinator();$float = 10000000000;
echo "-------------incorrect limit Iterator float seek----------\n";
foreach(new limitIterator($comb,$float,3) as $current){ echo
$current."\n";}
echo "-------------correct----------\n";
for($comb->seek($float) ; $comb->current() < $float+3 &&
$comb->valid();$comb->next()){ echo $comb->current()."\n";}
Expected result:
----------------
-------------incorrect limit Iterator float seek----------
10000000000
10000000001
10000000002
-------------correct----------
10000000000
10000000001
10000000002
Actual result:
--------------
-------------incorrect limit Iterator float seek----------
1410065408
1410065409
1410065410
-------------correct----------
10000000000
10000000001
10000000002
--
Edit bug report at https://bugs.php.net/bug.php?id=62477&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62477&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62477&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62477&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=62477&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62477&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=62477&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=62477&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=62477&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=62477&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=62477&r=support
Expected behavior: https://bugs.php.net/fix.php?id=62477&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=62477&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=62477&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=62477&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62477&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=62477&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=62477&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=62477&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=62477&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=62477&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=62477&r=mysqlcfg