Bug #54163 [NEW]: get NaN with intl MessageFormatter or NumberFormatter

From: Date: Fri, 04 Mar 2011 21:42:08 +0000
Subject: Bug #54163 [NEW]: get NaN with intl MessageFormatter or NumberFormatter
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-159222@lists.php.net to get a copy of this message
From: Operating system: MacOsX 10.6.6 PHP version: 5.3.5 Package: I18N and L10N related Bug Type: Bug Bug description:get NaN with intl MessageFormatter or NumberFormatter 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 -- Edit bug report at http://bugs.php.net/bug.php?id=54163&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54163&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54163&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54163&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=54163&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54163&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=54163&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=54163&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=54163&r=needscript Try newer version: http://bugs.php.net/fix.php?id=54163&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=54163&r=support Expected behavior: http://bugs.php.net/fix.php?id=54163&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=54163&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=54163&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=54163&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54163&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=54163&r=dst IIS Stability: http://bugs.php.net/fix.php?id=54163&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=54163&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=54163&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=54163&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=54163&r=mysqlcfg

« previous php.bugs (#159222) next »