|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 13 16:01:30 2024 UTC