Edit report at https://bugs.php.net/bug.php?id=55290&edit=1
ID: 55290 Comment by: mail at michael-weimann dot eu Reported by: franssen dot roland at gmail dot com Summary: \NumberFormatter::parseCurrency() fails Status: Open Type: Bug Package: I18N and L10N related Operating System: Linux PHP Version: 5.3.6 - 5.3.8 Block user comment: N Private report: N New Comment: Doesn't work in PHP 5.3.10 intl version 1.1.0 ICU version 4.8.1.1 ICU Data version 4.8.1 Previous Comments: ------------------------------------------------------------------------ [2012-05-05 09:15:37] franssen dot roland at gmail dot com Still fails in PHP 5.4RC9... version 1.1.0 ICU version 4.4.2 ICU Data version 4.4.2 ------------------------------------------------------------------------ [2011-11-09 04:56:08] johnlinton at mailinator dot net Seeing the same issue except I am using PHP 5.3.8 as a fcgi module under apache 2.2 on Windows 7. ------------------------------------------------------------------------ [2011-08-23 18:09:34] franssen dot roland at gmail dot com Still fails in 5.3.8... However it does seems to work when parsing in locale en[_US], e.g. $1 returns float(1) ("USD"). Didn't spot any other locales that work (mostly tested european locales; netherlands, germany, french) ------------------------------------------------------------------------ [2011-07-28 07:04:52] franssen dot roland at gmail dot com Same code does works on PHP 5.2.17 (Linux) version 1.0.3 ICU version 3.6 ------------------------------------------------------------------------ [2011-07-26 20:23:42] franssen dot roland at gmail dot com Description: ------------ Hi, The example code at http://nl2.php.net/manual/en/numberformatter.parsecurrency.php doesn't seem to work for me. This is perhaps also related to bug #54163 (?) --- version 1.1.0 ICU version 4.4.1 Directive Local Value Master Value intl.default_locale no value no value intl.error_level 0 0 Test script: --------------- <?php $fmt = numfmt_create( 'de_DE', NumberFormatter::CURRENCY ); $num = "1.234.567,89 $"; echo "We have ".numfmt_parse_currency($fmt, $num, $curr)." in $curr\n"; echo \PHP_EOL; $fmt = new NumberFormatter( 'de_DE', NumberFormatter::CURRENCY ); $num = "1.234.567,89 $"; echo "We have ".$fmt->parseCurrency($num, $curr)." in $curr\n"; die; Expected result: ---------------- We have 1234567.89 in USD We have 1234567.89 in USD Actual result: -------------- We have <FALSE> in <NULL> We have <FALSE> in <NULL> ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=55290&edit=1