php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50018 Typo in spl_limit_it_seek()
Submitted: 2009-10-27 14:36 UTC Modified: 2009-10-27 21:57 UTC
From: wimartin at uk dot ibm dot com Assigned:
Status: Closed Package: SPL related
PHP Version: 5.2SVN-2009-10-27 (snap) OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: wimartin at uk dot ibm dot com
New email:
PHP Version: OS:

 

 [2009-10-27 14:36 UTC] wimartin at uk dot ibm dot com
Description:
------------
There is a typo in spl_limit_it_seek() in iterators.c. An exception is thrown with the message "Cannot seek to %ld which is behind offest %ld plus count %ld".

"offest" should in fact, be "offset".

iterator_032.phpt tests this functionality but the expected output is incorrect as well.

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

$it = new LimitIterator(new ArrayIterator(array(1,2,3,4)), 1, 2);

try
{
    $it->seek(3);
}
catch(OutOfBoundsException $e)
{
    echo $e->getMessage() . "\n";
}

?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-27 21:57 UTC] svn@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=290002
Log: - Fixed bug #50018 (Typo in spl_limit_it_seek())
 [2009-10-27 21:57 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 11:01:34 2025 UTC