Skip to content

Commit f6fae19

Browse files
committed
ext/intl: expose dateformat UDAT_PATTERN constant.
Close GH-12258
1 parent 62e2402 commit f6fae19

File tree

5 files changed

+20
-3
lines changed

5 files changed

+20
-3
lines changed

NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ Core:
88
DOM:
99
. Added DOMNode::compareDocumentPosition(). (nielsdos)
1010

11+
Intl:
12+
. Added IntlDateFormatter::PATTERN constant. (David Carlier)
13+
1114
Standard:
1215
. Implement GH-12188 (Indication for the int size in phpinfo()). (timwolla)
1316
. Partly fix GH-12143 (Incorrect round() result for 0.49999999999999994).

UPGRADING

+4
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ PHP 8.4 UPGRADE NOTES
8282
10. New Global Constants
8383
========================================
8484

85+
- Intl:
86+
. The IntlDateFormatter class exposes now the new PATTERN constant
87+
reflecting udat api's UDAT_PATTERN.
88+
8589
========================================
8690
11. Changes to INI File Handling
8791
========================================

ext/intl/dateformat/dateformat.stub.php

+5
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ class IntlDateFormatter
5050
* @cvalue UDAT_SHORT_RELATIVE
5151
*/
5252
public const RELATIVE_SHORT = UNKNOWN;
53+
/**
54+
* @var int
55+
* @cvalue UDAT_PATTERN
56+
*/
57+
public const PATTERN = UNKNOWN;
5358

5459
/**
5560
* @var int

ext/intl/dateformat/dateformat_arginfo.h

+7-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/intl/tests/gh12243.phpt

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ intl
77
<?php
88

99
$datetime = new \DateTime('2017-05-12 23:11:00 GMT+2');
10-
static $UDAT_PATTERN = -2;
1110

1211
try {
1312
new IntlDateFormatter(
1413
locale: 'en',
15-
dateType: $UDAT_PATTERN,
14+
dateType: IntlDateFormatter::PATTERN,
1615
timeType: 0,
1716
timezone: $datetime->getTimezone(),
1817
);

0 commit comments

Comments
 (0)