summaryrefslogtreecommitdiff
path: root/ext/intl/tests/bug59597_32.phpt
blob: 928a235a83fc31d7b2af192c4b7feb895ea57c07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--TEST--
Bug#59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK"; ?>
--FILE--
<?php

$formatter = new \NumberFormatter('en', \NumberFormatter::DECIMAL);
$value = $formatter->parse('2147483647', \NumberFormatter::TYPE_INT32);
var_dump($value);

$formatter = new \NumberFormatter('en', \NumberFormatter::DECIMAL);
$value = $formatter->parse('2147483650', \NumberFormatter::TYPE_INT64);
var_dump($value);

?>
--EXPECT--
int(2147483647)
float(2147483650)