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:
IntlRelativeDateTimeFormatterStyle(Long,Short,Narrow);IntlRelativeDateTimeFormatterCapitalization(None,MiddleOfSentence,BeginningOfSentence,UiListAndMenu,Standalone);IntlRelativeDateTimeFormatterUnit(YearthroughSecond, plusSundaythroughSaturday).
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:
format(int|float $offset, $unit)uses a text form when the locale has one ("yesterday", "last week") and otherwise falls back to a numeric form;formatNumeric()always uses the numeric form ("1 day ago", "in 1.5 hours");combineDateAndTime(string $relativeDate, string $time)joins two already formatted strings with the locale's date-time separator. It does not parse or validate them;getErrorCode()andgetErrorMessage()follow the usual ext/intl error conventions. ICU failures returnfalse, or throw ifintl.use_exceptionsis on. A wrong enum argument always throwsTypeError.
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.