Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Intl: Add a new IntlListFormatter class #18519
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
Intl: Add a new IntlListFormatter class #18519
Changes from all commits
ea1ee1c
9236166
29f0ebb
a2dd8e9
e31bfe4
8524fdc
a096a14
7ef1380
6852001
3851509
1f64694
7b55c89
a7e9a29
5d2ca4c
c5917a8
a792f88
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One optimization that you could do (optional) is using
zval_get_tmp_string
instead. Although it probably doesn't matter too much hereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: do you get a warning during your build if you remove the (void *) cast ? unsure it s really necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, I get a warning:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the const qualifier ... can items just be mutable and eventually doing the cast at
ulistfmt_format
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm... I'm not sure if that's simpler because we also need to convert it to utf16
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quick question, do you think there is a benefit of using
ulistfmt_formatStringsToResult
beside the "no need to calculate the buffer first" ? any drawback ? Think more of use case to apply in php rather than api conveniency. Cheers.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note I m not holding the PR merge at all, just asking out of curiosity/trying to see a possible future improvement :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what would be the advantage (besides not calculating the buffer). The drawback is that it's supported since ICU 64 and PHP Intl supports 57 and up. I guess we could conditionally use it for >= ICU 64, but personally I would keep the code simple :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say this ...
ulistfmt_formatStringsToResult
is not necessarily interesting by itself but what you can get out of it however is what is called field positions via aUFieldPositionIterator
, going through it withufieldpositer_next
... you can get nice additional infos ... but again my question was more to give food for thoughts ;)