1--TEST--
2Bug #71516 IntlDateFormatter losts locale if pattern is set via constructor
3--EXTENSIONS--
4intl
5--FILE--
6<?php
7
8$loc = "ru_RU";
9$goodFormatter = new IntlDateFormatter($loc, IntlDateFormatter::FULL, IntlDateFormatter::FULL, new DateTimeZone("UTC"));
10$badFormatter  = new IntlDateFormatter($loc, IntlDateFormatter::FULL, IntlDateFormatter::FULL, new DateTimeZone("UTC"), null, "d MMM");
11$badFormatter2 = new IntlDateFormatter($loc, IntlDateFormatter::FULL, IntlDateFormatter::FULL, new DateTimeZone("UTC"));
12$badFormatter2->setPattern("d MMM");
13
14echo "Formatter without pattern: " . $goodFormatter->getLocale() . PHP_EOL;
15echo "Formatter with pattern: " . $badFormatter->getLocale() . PHP_EOL;
16echo "Formatter with pattern set later: " . $badFormatter2->getLocale() . PHP_EOL;
17
18?>
19--EXPECT--
20Formatter without pattern: ru
21Formatter with pattern: ru
22Formatter with pattern set later: ru
23