Skip to content

Fix #78308: IntlPartsIterator key is wrong for KEY_LEFT/KEY_RIGHT #4446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Jul 20, 2019

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.

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.
@petk petk added the Bug label Jul 20, 2019
@nikic
Copy link
Member

nikic commented Jul 24, 2019

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.

As these are static functions we are free to change them -- maybe directly go with the "clean" solution?

@cmb69
Copy link
Member Author

cmb69 commented Jul 24, 2019

I'm uneasy to do this as bugfix targeting PHP-7.2.

@cmb69
Copy link
Member Author

cmb69 commented Jul 24, 2019

@smalyshev, what do you think?

@TRowbotham
Copy link
Contributor

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.

@cmb69
Copy link
Member Author

cmb69 commented Nov 20, 2019

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.

@cmb69
Copy link
Member Author

cmb69 commented Mar 24, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants