From:             eskwayrd at gmail dot com
Operating system: Linux
PHP version:      5.4.9
Package:          I18N and L10N related
Bug Type:         Bug
Bug description:MessageFormatter buggy when using select formats with nested 
parameters

Description:
------------
When a message formatter formats selects with nested variables, its
behaviour is 
buggy.

Test script:
---------------
// attempting to translate file size
$locale = 'en_US';
$args = array(1.23435, 'M');
$format = "{1, select, k {{0} kB} M {{0} MB} other {{0} B}}";
echo "#1: ". msgfmt_format_message($locale, $format, $args) ."\n";

$format = "{1, select, k {{0} kB} M {{0, number, #.##} MB} other {{0}
B}}";
echo "#2: ". msgfmt_format_message($locale, $format, $args) ."\n";
echo "Error? ". intl_get_error_message() ."\n";

Expected result:
----------------
#1: 1.23435 MB
#2: 1.23 MB
Error? U_ZERO_ERROR


Actual result:
--------------
#1: 1.23435 MB
#2: 
Error? Creating message formatter failed: U_ARGUMENT_TYPE_MISMATCH

-- 
Edit bug report at https://bugs.php.net/bug.php?id=63724&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=63724&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=63724&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=63724&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=63724&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=63724&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=63724&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=63724&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=63724&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=63724&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=63724&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=63724&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=63724&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=63724&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63724&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=63724&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=63724&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=63724&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=63724&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=63724&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=63724&r=mysqlcfg

Reply via email to