php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70484 selectordinal doesn't work with named parameters
Submitted: 2015-09-13 21:35 UTC Modified: -
From: sam at rmcreative dot ru Assigned:
Status: Closed Package: intl (PECL)
PHP Version: 5.5.29 OS: Windows 8.1
Private report: No CVE-ID: None
 [2015-09-13 21:35 UTC] sam at rmcreative dot ru
Description:
------------
intl 51.2 errors out when trying to create a pattern with named parameter {n} (or any other name) used in "selectordinal". It should work as in case with "plural" and all other patterns.

Positional placeholder {0} works as expected.

Test script:
---------------
<?php
$m = new MessageFormatter('en', '{n, selectordinal, one{#-one} two{#-two} few{#-few} other{#-other}}');
var_dump($m->format(array('n' => 42)));

Expected result:
----------------
42-two

Actual result:
--------------
{n, selectordinal, one{#-one} two{#-two} few{#-few} other{#-other}}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-11 13:02 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=28b6f66a77d660412766b6da88d01377cbdd04a1
Log: Fixed bug #70484 selectordinal doesn't work with named parameters
 [2016-04-11 13:02 UTC] ab@php.net
-Status: Open +Status: Closed
 [2016-06-02 10:21 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=22336db97f0a61260e31b423036324bb95b1ff28
Log: Fixed bug #70484 selectordinal doesn't work with named parameters
 [2016-07-20 11:32 UTC] davey@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=28b6f66a77d660412766b6da88d01377cbdd04a1
Log: Fixed bug #70484 selectordinal doesn't work with named parameters
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 11:01:28 2024 UTC