summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-03-18 11:39:58 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-03-18 11:39:58 +0100
commit623a11d7de80c9f6c9d7dc223071e701df450820 (patch)
treeac84a039e3028d94ae86d8b5fa7156845c9192e3
parent82fbaab53c4ea6fb8417cbad8254b8475e50b4cd (diff)
parent433758ceb3e11df184a87e8185fbd7f8b969fb79 (diff)
downloadphp-git-623a11d7de80c9f6c9d7dc223071e701df450820.tar.gz
Merge branch 'PHP-7.2' into PHP-7.3
-rw-r--r--ext/intl/dateformat/dateformat_format_object.cpp2
-rw-r--r--ext/intl/tests/dateformat_bug65683_2.phpt12
2 files changed, 13 insertions, 1 deletions
diff --git a/ext/intl/dateformat/dateformat_format_object.cpp b/ext/intl/dateformat/dateformat_format_object.cpp
index 7a3979a043..c2429fb592 100644
--- a/ext/intl/dateformat/dateformat_format_object.cpp
+++ b/ext/intl/dateformat/dateformat_format_object.cpp
@@ -175,7 +175,7 @@ U_CFUNC PHP_FUNCTION(datefmt_format_object)
goto cleanup;
}
cal = obj_cal->clone();
- } else if (instanceof_function(instance_ce, php_date_get_date_ce())) {
+ } else if (instanceof_function(instance_ce, php_date_get_interface_ce())) {
if (intl_datetime_decompose(object, &date, &timeZone, NULL,
"datefmt_format_object") == FAILURE) {
RETURN_FALSE;
diff --git a/ext/intl/tests/dateformat_bug65683_2.phpt b/ext/intl/tests/dateformat_bug65683_2.phpt
new file mode 100644
index 0000000000..67d9d7884a
--- /dev/null
+++ b/ext/intl/tests/dateformat_bug65683_2.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #65683: Intl does not support DateTimeImmutable (using datefmt_format_object)
+--FILE--
+<?php
+$date = date_create('1970-01-01');
+$date_imm = date_create_immutable('1970-01-01');
+var_dump(datefmt_format_object($date, null, 'fr_FR'));
+var_dump(datefmt_format_object($date_imm, null, 'fr_FR'));
+?>
+--EXPECT--
+string(24) "1 janv. 1970 à 00:00:00"
+string(24) "1 janv. 1970 à 00:00:00"