-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ext/intl: GH-17006 part 1, NumberFormat and NumberFormatter co-existing. #17073
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
base: master
Are you sure you want to change the base?
Conversation
…sting. Those APIs are not particularly 1:1, here using NumberFormatter for NumberFormatter::format/numft_format at the moment, trying to assess what's possible for next.
8177c3b
to
c5000b0
Compare
097ce25
to
a180872
Compare
Calling just ::format is more straightforward.
cc @cmb69 when you get the chance .. no need to be too "pedantic" about details for now just to know if I m heading in the right direction(s). |
Hmm, not sure whether this approach is the best idea. Maybe it's better to postpone using Another option might be to additionally support Perhaps this should be discussed on the internal mailing list first. |
Thanks for your time. I would rather aim 9.0 but ideally there should be no change in the php POV, do not know if writing to ML is enough in that case ? |
@devnexen Imo, having both implementations in the same PHP class might cause some complications if we'll try to implement other ICU classes/functions that depend on the NumberFormatter. Some ICU classes like RelativeDateTimeFormatter accepts the old NumberFormat, while newer classes like NumberRangeFormatter use the newer NumberFormatter. I mean, sure, there might be some checks at runtime that validates if the right NF is used, but imho this sounds like a bad API design and a bit opaque. What do you think if we do the same thing ICU did and implement a separate class? For example, we could namespace it like |
Seeing that both do not match feature wise and NumberFormat is going to be obsolete, it makes more sense to separate them. Only needs to work out future missing features (e.g. currency parsing I believe). |
Those APIs are not particularly 1:1, here using NumberFormatter for NumberFormatter::format/numft_format at the moment, trying to assess what's possible for next.