mirror of
https://github.com/php/php-src.git
synced 2026-04-21 15:08:16 +02:00
b93e4aa11c
Since we're dealing with floating point numbers, precision issues may hit us, and actually it's not necessary to check for the exact number anyway, because it is not exact in the first place. Therefore, we relax the test expectations.
19 lines
579 B
PHP
19 lines
579 B
PHP
--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));
|
|
?>
|
|
--EXPECTF--
|
|
string(21) "823749273428379%c%c%c%c%c%c"
|
|
string(1) "1"
|