Skip to content

ext/intl: expose dateformat UDAT_PATTERN constant. #12258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ext/intl/dateformat/dateformat.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class IntlDateFormatter
* @cvalue UDAT_SHORT_RELATIVE
*/
public const RELATIVE_SHORT = UNKNOWN;
/**
* @var int
* @cvalue UDAT_PATTERN
*/
public const PATTERN = UNKNOWN;

/**
* @var int
Expand Down
8 changes: 7 additions & 1 deletion ext/intl/dateformat/dateformat_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions ext/intl/tests/gh12243.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ intl
<?php

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

try {
new IntlDateFormatter(
locale: 'en',
dateType: $UDAT_PATTERN,
dateType: IntlDateFormatter::PATTERN,
timeType: 0,
timezone: $datetime->getTimezone(),
);
Expand Down