summaryrefslogtreecommitdiff
path: root/ext/intl/tests/bug80763.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/tests/bug80763.phpt')
-rw-r--r--ext/intl/tests/bug80763.phpt16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/intl/tests/bug80763.phpt b/ext/intl/tests/bug80763.phpt
new file mode 100644
index 0000000000..bd5aeb45c6
--- /dev/null
+++ b/ext/intl/tests/bug80763.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #80763 (msgfmt_format() does not accept DateTime references)
+--SKIPIF--
+<?php
+if (!extension_loaded('intl')) die('skip intl extension not available');
+?>
+--FILE--
+<?php
+$today = new DateTime('2021-02-17 12:00:00');
+$formatter = new \MessageFormatter('en_US', 'Today is {today, date, full}.');
+$params = ['today' => $today];
+array_walk($params, fn() => 1);
+var_dump($formatter->format($params));
+?>
+--EXPECT--
+string(38) "Today is Wednesday, February 17, 2021."