xref: /PHP-7.0/ext/intl/tests/bug59597_32.phpt (revision 5cbf2d67)
1--TEST--
2Bug#59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer
3--SKIPIF--
4<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
5<?php echo PHP_INT_SIZE == 8 ? "skip 32-bit only" : "OK"; ?>
6--FILE--
7<?php
8
9$formatter = new \NumberFormatter('en', \NumberFormatter::DECIMAL);
10$value = $formatter->parse('2147483647', \NumberFormatter::TYPE_INT32);
11var_dump($value);
12
13$formatter = new \NumberFormatter('en', \NumberFormatter::DECIMAL);
14$value = $formatter->parse('2147483650', \NumberFormatter::TYPE_INT64);
15var_dump($value);
16
17?>
18--EXPECT--
19int(2147483647)
20float(2147483650)
21
22