phpstorm.dev

PHP ecosystem insights

PHP knowledge

Versioned PHP knowledge with primary sources and explicit verification dates.

Source checks through 2026-10-27 · 57 sources · This published snapshot is over 48 hours old.

Verified 2026-10-22 implemented Permanent entry

IntlRelativeDateTimeFormatter proposal

Accepted 25–0–0 and merged into php-src master (PHP 8.7.0-dev) on 22 October 2026; not in any released PHP version. The RFC (version 0.4.1, dated 2026-08-09, author Weilin Du) had one primary question, "Add IntlRelativeDateTimeFormatter as described to ext/intl?", which needed a 2/3 majority. The vote ended on 2026-10-22 at 00:00 UTC. The RFC page shows the closed poll with a final result of 25 yes, 0 no and 0 abstain, and at 01:44 UTC the author announced on internals that the RFC is accepted. An edit at 01:45 UTC ("update status") changed the page header to Status: Implemented, and the official RFC index collected at 04:01 UTC lists it as implemented. php-src PR #23514 was merged into master at 01:47 UTC (one commit changing 35 files). When checked at about 04:10 UTC, master reported 8.7.0-dev, and its UPGRADING lists the class and the three enums under Intl for PHP 8.7. PHP 8.7 has no release date in the sources read here, and code on master can still change before a release.

Vote history. The author announced the start of voting at 16:14 UTC on 7 October, after a page edit at 16:10 UTC. That was earlier than the start the author had given: an intent-to-vote message on 5 October and a voting section added at 10:02 UTC on 7 October both said 2026-10-08 00:00 UTC. Interim counts were 7–0–0 on 7 October and 18–0–0 on 14 October, when an edit changed the header from Under Discussion to Voting. The discussion thread began in August.

What is proposed

A new final class IntlRelativeDateTimeFormatter in ext/intl, wrapping ICU's URelativeDateTimeFormatter C API (stable since ICU 57, and ext/intl already requires ICU 57.1 or newer). It would produce strings such as "yesterday", "in 3 days" or "5 minutes ago" for a locale. The class and three pure (unbacked) enums would live in the global namespace:

The constructor takes ?string $locale (where null means the default intl locale), a style, a capitalization context and an optional NumberFormatter. The formatter keeps the supplied NumberFormatter, so later configuration changes to it affect later output. Methods:

The RFC does not change IntlDateFormatter::RELATIVE_*, which formats a concrete date. No procedural aliases or integer constants are added. The backward-compatibility section notes that the four new global names could conflict with userland declarations while intl is loaded. The changelog records changes made in response to feedback from Tim Düsterhus and others, such as adopting the three pure enums on 2026-09-19.

Limitations

The RFC page still says "Voting thread: TBD" and "Patches and Tests: TBD", although the vote was announced on internals and the implementation PR is merged; this page treats the PR and UPGRADING as the implementation evidence. The merged code was not reviewed line by line against the RFC text, so behaviour described above comes from the RFC and UPGRADING. The example output strings depend on ICU locale data and version. Related: intl_date_format() proposal, a separate ext/intl draft.