Skip to content

Platform notes

These notes describe runtime support and limitations.

PHP limitations

PHP v3 supports compact(), relativeDuration(), numberRange(), moneyRange(), and dateRange(). Where ext-intl lacks a formatter, Cosmo reads CLDR ResourceBundle data to assemble the result. Two limitations apply:

  • dateRange() supports short/medium only (CLDR ships no long/full interval skeletons that ext-intl can reach); it throws on long/full.
  • moneyRange() is approximate — it fills the CLDR range pattern but doesn't collapse the shared currency symbol the way native ICU does.

The following methods are unavailable in PHP because ext-intl does not expose the required APIs:

  • addLikelySubtags() / removeLikelySubtags() — no likely-subtags algorithm
  • bestMatch() / negotiating fromAcceptLanguage() — no LocaleMatcher binding
  • indexBuckets() — no AlphabeticIndex binding

Locale data

Cosmo reads locale data from ICU instead of maintaining hardcoded tables. Where a dedicated formatter is unavailable, the library assembles the result from ICU ResourceBundle data. Data updates follow the runtime or bundled ICU version. Updating Cosmo alone does not necessarily update locale data.