summaryrefslogtreecommitdiff
path: root/ext/intl/tests
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2021-02-17 17:31:47 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2021-02-17 17:31:47 +0100
commitb074e3b52b4dbc961b1b7e8ff80f6c6237666bbf (patch)
tree2d44f083dabe25f124b97322f4ecc3315460b1ec /ext/intl/tests
parentde5b42219c65f2d939caaa5ec8e39ead813ced15 (diff)
parent553a0c52b12d414c83130d845968fac5841236bf (diff)
downloadphp-git-b074e3b52b4dbc961b1b7e8ff80f6c6237666bbf.tar.gz
Merge branch 'PHP-8.0'
* PHP-8.0: Fix #80763: msgfmt_format() does not accept DateTime references
Diffstat (limited to 'ext/intl/tests')
-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."