Re: [RFC] IntlRelativeDateTimeFormatter

From: Date: Sat, 08 Aug 2026 17:38:46 +0000
Subject: Re: [RFC] IntlRelativeDateTimeFormatter
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-132193@lists.php.net to get a copy of this message
Hi David, I tried this as an experimental feature. The implementation is way more smoother than I expected. As the numberFormatter class in PHP side is somehow very suitable for this.   The proposed constructor is now:   public function __construct(       ?string $locale = null,       int $style = self::STYLE_LONG,       int $capitalizationContext = self::CAPITALIZATION_NONE,       ?NumberFormatter $numberFormatter = null,   ) {} Also, considering enums and namespaces. Tim raised this suggestion to me before. So I'd like to put this in the future scope of this RFC. A broader ext/intl modernization RFC could revisit namespaces and PHP enums consistently across intl classes. This is not we are supposed to do in this specific RFC imho. However, the idea is reasonable.  Thanks for the feedback! Cheers, Weilin

« previous php.internals (#132193) next »