|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54163 get NaN with intl MessageFormatter or NumberFormatter
Submitted: 2011-03-04 22:42 UTC Modified: 2012-03-23 17:48 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: lingtalfi at gmail dot com Assigned:
Status: No Feedback Package: I18N and L10N related
PHP Version: 5.3.5 OS: MacOsX 10.6.6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
19 + 21 = ?
Subscribe to this entry?

 [2011-03-04 22:42 UTC] lingtalfi at gmail dot com
Hi, I use macport php5.3 and intl

my configuration 
Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/1.0.0d DAV/2 PHP/5.3.5 

trying intl functions, I get NaN value instead of expected (int) value.
Also had similar issue with NumberFormatter.

Test script:
    $format_FR = 'Le {0,date,full} à {1,time,short}, {2,number,integer} pommes coûtent {3,number,currency}';
    $format_US = 'On {0,date,full} at {1,time,short}, {2,number,integer} apples cost {3,number,currency}';
    $data = array(time(), time(), 5, 3);
    echo MessageFormatter::formatMessage('fr_FR', $format_FR, $data) . "<br />";
    echo MessageFormatter::formatMessage('en_US', $format_US, $data) . "<br />";

Expected result:
Le vendredi 4 mars 2011 à 22:37, 5 pommes coûtent 3 €
On Friday, March 4, 2011 at 10:37 PM, 5 apples cost $3

Actual result:
Le vendredi 4 mars 2011 à 22:37, 5 pommes coûtent NaN
On Friday, March 4, 2011 at 10:37 PM, 5 apples cost NaN


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-05 02:23 UTC] Louis dot cellier at hotmail dot com
Don't want to be rude. Can you show your array $data used on this exemple ?
 [2011-03-05 06:41 UTC] lingtalfi at gmail dot com
$data = array(time(), time(), 5, 3);
 [2011-03-05 13:50 UTC]
I can't reproduce it.

"Le samedi 5 mars 2011 à 09:49, 5 pommes coûtent 3,00 €
On Saturday, March 5, 2011 at 9:49 AM, 5 apples cost $3.00"
 [2011-03-05 14:01 UTC] lingtalfi at gmail dot com
Maybe you don't have the same os or config ?
lucky you.
 [2011-03-05 14:09 UTC]
-Status: Open +Status: Feedback
 [2011-03-05 14:09 UTC]
Please try using this snapshot:
For Windows:

 [2011-03-05 14:13 UTC] lingtalfi at gmail dot com
-Status: Feedback +Status: Open
 [2011-03-05 14:13 UTC] lingtalfi at gmail dot com
by the way I forgot to post my intl settings :

Internationalization support	enabled
version 	1.1.0
ICU version 	4.6

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

I'll give this a try :

 [2011-03-05 15:58 UTC] lingtalfi at gmail dot com
I'm sorry, I cannot do it (newbie skills),
I willl switch back to macport for now and ...
just wait and hope.
 [2012-03-23 17:48 UTC]
-Status: Open +Status: No Feedback
 [2012-03-23 17:48 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 13:01:29 2024 UTC