Fix #78308: IntlPartsIterator key is wrong for KEY_LEFT/KEY_RIGHT#4446
Fix #78308: IntlPartsIterator key is wrong for KEY_LEFT/KEY_RIGHT#4446cmb69 wants to merge 1 commit intophp:PHP-7.2from
Conversation
We must not increase the iterator's index after it has been properly determined. A clean solution would be to increment the index in the internal `*_move_forward()` methods instead of `IntlIterator::next()`, but since the `*_move_forward()` methods are currently also called by the internal `*_rewind()` methods, and don't have a flag to determine the (intent of the) caller, we apply a hack for now. We also fix the erroneous expectations of an existing test case.
As these are static functions we are free to change them -- maybe directly go with the "clean" solution? |
|
I'm uneasy to do this as bugfix targeting PHP-7.2. |
|
@smalyshev, what do you think? |
|
Hi @cmb69, since I reported this bug I just wanted to followup given that 7.2's active support ends in 10 days and this fix seems to be stalled on a question about including it in 7.2. |
|
I don't think that we should fix it for 7.2 any longer. I'm neither comfortable merging the hack presented by this PR, nor by merging a clean solution into the last bugfix release. |
|
I'm going to close this PR. It probably makes no sense to have this hackish solution in PHP 7.4, and I hope someone comes up with a clean solution for PHP 8.x. |
We must not increase the iterator's index after it has been properly
determined. A clean solution would be to increment the index in the
internal
*_move_forward()methods instead ofIntlIterator::next(),but since the
*_move_forward()methods are currently also called bythe internal
*_rewind()methods, and don't have a flag to determinethe (intent of the) caller, we apply a hack for now.
We also fix the erroneous expectations of an existing test case.