|  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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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-2021 The PHP Group
All rights reserved.
Last updated: Wed Apr 21 12:01:23 2021 UTC