php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #54176 locale_compose accepts more than 3 extlang
Submitted: 2011-03-07 08:43 UTC Modified: 2021-06-15 09:32 UTC
Votes:2
Avg. Score:1.5 ± 0.5
Reproduced:0 of 2 (0.0%)
From: giorgio dot liscio at email dot it Assigned: cmb (profile)
Status: Closed Package: intl (PECL)
PHP Version: 5.3.5 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: giorgio dot liscio at email dot it
New email:
PHP Version: OS:

 

 [2011-03-07 08:43 UTC] giorgio dot liscio at email dot it
Description:
------------
hi, just a "cosmetic problem"

probably are affected variants and privates too

bad result:

<?php
$arr = array(
    'language'=>'en' ,
    'script'  =>'Hans' ,
    'region'  =>'CN'
    'extlang' => array('a','b','c','d','e','f')
);
echo locale_compose( $arr );
?>

good result:

<?php
$arr = array(
    'language'=>'en' ,
    'script'  =>'Hans' ,
    'region'  =>'CN'
    'extlang0' => 'a',
    'extlang1' => 'b',
    'extlang2' => 'c',
    'extlang3' => 'd'
);
echo locale_compose( $arr );
?>



Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-12 14:07 UTC] cmb@php.net
-Status: Open +Status: Verified -Package: I18N and L10N related +Package: intl
 [2017-09-12 14:07 UTC] cmb@php.net
See <https://3v4l.org/knFrX> (correct behavior) vs.
<https://3v4l.org/mKqT4> (erroneous behavior, since only up to
three extlangs are supposed to be supported).

Apparently, the max_value which is regarded for multiple numbered
keys [1] is ignored for the single array case[2].

[1] <https://github.com/php/php-src/blob/PHP-7.0.23/ext/intl/locale/locale_methods.c#L858-L866>
[2] <https://github.com/php/php-src/blob/PHP-7.0.23/ext/intl/locale/locale_methods.c#L837-L852>
 [2021-06-14 16:18 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #54176: locale_compose accepts more than 3 extlang
On GitHub:  https://github.com/php/php-src/pull/7152
Patch:      https://github.com/php/php-src/pull/7152.patch
 [2021-06-14 16:25 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2021-06-15 09:32 UTC] cmb@php.net
-Type: Bug +Type: Documentation Problem
 [2021-06-15 09:32 UTC] cmb@php.net
After closer analysis, this is intended behavior, so the
documentation needs to be fixed.
 [2021-06-15 09:35 UTC] git@php.net
Automatic comment on behalf of cmb69
Revision: https://github.com/php/doc-en/commit/e9340fb6bcb73976f0d18225b9fdbb49ba034100
Log: Fix #54176: locale_compose accepts more than 3 extlang
 [2021-06-15 09:35 UTC] git@php.net
-Status: Verified +Status: Closed
 [2021-06-15 11:35 UTC] git@php.net
Automatic comment on behalf of mumumu
Revision: https://github.com/php/doc-ja/commit/702ab779a0472b62e62ddf4e0ffc5103dae107be
Log: Fix #54176: locale_compose accepts more than 3 extlang
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Aug 01 04:01:24 2021 UTC