|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77006 reaching the end of a intliterator makes it unusable
Submitted: 2018-10-12 06:59 UTC Modified: -
From: dontspamwespls at example dot org Assigned:
Status: Open Package: intl (PECL)
PHP Version: 7.3.0RC3 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: dontspamwespls at example dot org
New email:
PHP Version: OS:


 [2018-10-12 06:59 UTC] dontspamwespls at example dot org
once valid() becomes false, previous() stops working

Test script:

$iteratorx = IntlCodePointBreakIterator::createCodePointInstance();

$iterator = $iteratorx->getPartsIterator();
$iteratorx->previous(); // previous works
echo $iterator->current() . "\n"; // c... all fine

$iterator->next(); // no more code points, so it's invalid
var_dump($iterator->valid()); // false
var_dump($iterator->current()); // prints weird stuff... whatever...

$iteratorx->previous(); // cannot go back
var_dump($iterator->valid()); // broken
var_dump($iterator->current()); // broken

Expected result:
I expect valid() to be true after previous(), and current() set to the last code point


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri May 24 07:01:26 2019 UTC