|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59597 NumberFormatter::parse() with TYPE_INT64 results in a 32 bit integer
Submitted: 2011-01-30 02:34 UTC Modified: 2012-04-19 18:39 UTC
From: eriksencosta at gmail dot com Assigned: stas (profile)
Status: Closed Package: intl (PECL)
PHP Version: 5.3.2 OS: Ubuntu 10.10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: eriksencosta at gmail dot com
New email:
PHP Version: OS:


 [2011-01-30 02:34 UTC] eriksencosta at gmail dot com
First, my PHP version is 5.3.5. The bugtracker have this version missing.

I was testing the \NumberFormatter class when I got stuck in a behaviour that I don't know if is by design or not.

Simply, I was expecting a 64 bit integer when calling the parse() method with the $type = \NumberFormatter::TYPE_INT64 as my PHP is 64 bit compiled.

Tried searching the ICU bugtracker but don't found something related (but not sure, I'm not a C programmer):

Mine intl info:


Internationalization support => enabled
version => 1.1.0
ICU version => 4.2.1

Directive => Local Value => Master Value
intl.default_locale => no value => no value
intl.error_level => 0 => 0


Reproduce code:

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

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

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-04-19 18:39 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: stas
 [2012-04-19 18:39 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Oct 05 04:01:24 2023 UTC