Skip to content

Commit 65c9a3f

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
2 parents 4eb9e93 + 623a11d commit 65c9a3f

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

ext/intl/dateformat/dateformat_format_object.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
175175
goto cleanup;
176176
}
177177
cal = obj_cal->clone();
178-
} else if (instanceof_function(instance_ce, php_date_get_date_ce())) {
178+
} else if (instanceof_function(instance_ce, php_date_get_interface_ce())) {
179179
if (intl_datetime_decompose(object, &date, &timeZone, NULL,
180180
"datefmt_format_object") == FAILURE) {
181181
RETURN_FALSE;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
Bug #65683: Intl does not support DateTimeImmutable (using datefmt_format_object)
3+
--FILE--
4+
<?php
5+
$date = date_create('1970-01-01');
6+
$date_imm = date_create_immutable('1970-01-01');
7+
var_dump(datefmt_format_object($date, null, 'fr_FR'));
8+
var_dump(datefmt_format_object($date_imm, null, 'fr_FR'));
9+
?>
10+
--EXPECT--
11+
string(24) "1 janv. 1970 à 00:00:00"
12+
string(24) "1 janv. 1970 à 00:00:00"

0 commit comments

Comments
 (0)