php.net |  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
Votes:1
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
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: lingtalfi at gmail dot com
New email:
PHP Version: OS:

 

 [2011-03-04 22:42 UTC] lingtalfi at gmail dot com
Description:
------------
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] felipe@php.net
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] felipe@php.net
-Status: Open +Status: Feedback
 [2011-03-05 14:09 UTC] felipe@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [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 :
http://snaps.php.net/php5.3-latest.tar.gz

thanks
 [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] nikic@php.net
-Status: Open +Status: No Feedback
 [2012-03-23 17:48 UTC] nikic@php.net
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-2019 The PHP Group
All rights reserved.
Last updated: Mon Oct 14 08:01:26 2019 UTC