diff --git a/extra/intl-extra/IntlExtension.php b/extra/intl-extra/IntlExtension.php index 955d6ec9233..8b12fdd189c 100644 --- a/extra/intl-extra/IntlExtension.php +++ b/extra/intl-extra/IntlExtension.php @@ -423,7 +423,13 @@ private function createDateFormatter(?string $locale, ?string $dateFormat, ?stri $timeFormatValue = $timeFormatValue ?: $this->dateFormatterPrototype->getTimeType(); $timezone = $timezone ?: $this->dateFormatterPrototype->getTimeType(); $calendar = $calendar ?: $this->dateFormatterPrototype->getCalendar(); - $pattern = $pattern ?: $this->dateFormatterPrototype->getPattern(); + if ('' === $pattern) { + if (!$dateFormat && !$timeFormat) { // no explicit values for either format given + $pattern = $this->dateFormatterPrototype->getPattern(); + } else { + $pattern = null; + } + } } $hash = $locale.'|'.$dateFormatValue.'|'.$timeFormatValue.'|'.$timezone->getName().'|'.$calendar.'|'.$pattern;