|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2013-09-06 01:10 UTC] f21 dot groups at gmail dot com
Description:
------------
The choice conditional selector has been deprecated in ICU.
Instead, it is now recommended to use select, which does not seem to be supported.
$fmt = new MessageFormatter("fr_FR", "{0} est {1, select, female {allée} other {allé}}");
var_dump($fmt); //null
Test script:
---------------
<?php
$fmt = new MessageFormatter("fr_FR", "{0} est {1, select, female {allée} other {allé}}");
var_dump($fmt); //null
Expected result:
----------------
$fmt should not be null and should work propertly.
Actual result:
--------------
$fmt is null
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 10:00:02 2025 UTC |
Select format is definitely supported. I've copy-pasted your code and it works just fine with 5.3, 5.4 and 5.5. $fmt = new \MessageFormatter("fr_FR", "{0} est {1, select, female {allée} other {allé}}"); echo $fmt->format(array('Eugenia', 'female')); // result is 'Eugenia est allée' I guess the issue is that pattern should be in UTF-8 and you're using something else.