summaryrefslogtreecommitdiff
path: root/ext/intl/tests/bug79212.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/tests/bug79212.phpt')
-rw-r--r--ext/intl/tests/bug79212.phpt18
1 files changed, 18 insertions, 0 deletions
diff --git a/ext/intl/tests/bug79212.phpt b/ext/intl/tests/bug79212.phpt
new file mode 100644
index 0000000000..0f7897acc4
--- /dev/null
+++ b/ext/intl/tests/bug79212.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #79212 (NumberFormatter::format() may detect wrong type)
+--SKIPIF--
+<?php
+if (!extension_loaded('intl')) die('skip intl extension not available');
+if (!extension_loaded('gmp')) die('skip gmp extension not available');
+?>
+--FILE--
+<?php
+$fmt = new NumberFormatter('en_US', NumberFormatter::PATTERN_DECIMAL);
+var_dump($fmt->format(gmp_init('823749273428379492374')));
+
+$fmt = new NumberFormatter('en_US', NumberFormatter::PATTERN_DECIMAL);
+var_dump($fmt->format([1], NumberFormatter::TYPE_INT64));
+?>
+--EXPECT--
+string(21) "823749273428379400000"
+string(1) "1"