#50808 [Opn->Asn]: MessageFormatter buggy when using choice formats with nested parameters
ID: 50808
Updated by: jani@php.net
Reported By: bschussek at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: I18N and L10N related
-Operating System: Linux Ubuntu 9.10
+Operating System: *
-PHP Version: 5.3.1
+PHP Version: 5.3, 6
-Assigned To:
+Assigned To: stas
New Comment:
Stas, no compile here either.
Previous Comments:
------------------------------------------------------------------------
[2010-01-21 10:35:31] bschussek at gmail dot com
The build of your snapshot doesn't work for me. Did I do anything
wrong?
/bin/sh /home/.../php-5.3-latest/libtool --silent --preserve-dup-deps
--mode=compile /home/.../php-5.3-latest/meta_ccld -I/usr/include
-Iext/intl/ -I/home/.../php-5.3-latest/ext/intl/ -DPHP_ATOM_INC
-I/home/.../php-5.3-latest/include -I/home/.../php-5.3-latest/main
-I/home/.../php-5.3-latest -I/home/.../php-5.3-latest/ext/date/lib
-I/home/.../php-5.3-latest/ext/ereg/regex -I/usr/include/libxml2
-I/usr/include/mysql -I/home/.../php-5.3-latest/ext/sqlite3/libsqlite
-I/home/.../php-5.3-latest/TSRM -I/home/.../php-5.3-latest/Zend
-D_REENTRANT -DTHREAD=1 -I/usr/include -g -O2 -fvisibility=hidden
-pthread -DZTS -prefer-non-pic -c
/home/.../php-5.3-latest/ext/intl/resourcebundle/resourcebundle_class.c
-o ext/intl/resourcebundle/resourcebundle_class.lo
/home/.../php-5.3-latest/ext/intl/resourcebundle/resourcebundle_class.c:
In function resourcebundle_ctor:
/home/.../php-5.3-latest/ext/intl/resourcebundle/resourcebundle_class.c:90:
error: too few arguments to function zend_object_store_get_object
/home/.../php-5.3-latest/ext/intl/resourcebundle/resourcebundle_class.c:
In function resourcebundle_array_count:
/home/.../php-5.3-latest/ext/intl/resourcebundle/resourcebundle_class.c:250:
error: too few arguments to function zend_object_store_get_object
make: *** [ext/intl/resourcebundle/resourcebundle_class.lo] Fehler 1
------------------------------------------------------------------------
[2010-01-21 10:07:05] jani@php.net
Please try using this snapshot:
http://snaps.php.net/php5.3-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
[2010-01-20 19:47:55] bschussek at gmail dot com
Description:
------------
When a message formatter formats choices with nested variables, its
behaviour is buggy.
Interestingly, the code below works if you insert the parameter "{1}"
once more outside of the choice:
'There are {0,choice,0#are no {1} files|1#is one {1} file} ok {1}'
produces
There are are no text files ok text
There are is one image file ok image
Reproduce code:
---------------
$fmt = MessageFormatter::create('en_GB', 'There are {0,choice,0#are no
{1} files|1#is one {1} file} ok');
echo $fmt->format(array(0, "text")), "\n";
echo $fmt->format(array(1, "image")), "\n";
Expected result:
----------------
There are are no text files ok
There are is one image file ok
Actual result:
--------------
There are are no {1} files ok
There are is one {1} file ok
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50808&edit=1
Thread (8 messages)