|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchescollator_create (last revision 2013-06-28 21:14 UTC by poinsot dot julien at gmail dot co)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-07-15 00:38 UTC] felipe@php.net
-Status: Open
+Status: Assigned
-Package: intl
+Package: I18N and L10N related
-Assigned To:
+Assigned To: stas
[2014-06-08 23:06 UTC] stas@php.net
-Type: Bug
+Type: Documentation Problem
[2014-06-08 23:06 UTC] stas@php.net
[2014-06-08 23:24 UTC] stas@php.net
[2014-06-08 23:24 UTC] stas@php.net
-Status: Assigned
+Status: Closed
[2014-06-08 23:24 UTC] stas@php.net
[2020-02-07 06:08 UTC] phpdocbot@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 21:00:02 2025 UTC |
Description: ------------ There is an inconsistency between current PHP implemention and the documentation about Collator::__construct, Collator::create and collator_create. It says: Special values for locales can be passed in - if null is passed for the locale, the default locale collation rules will be used. If empty string ("") or "root" are passed, UCA rules will be used. But actual implementation of collator_ctor in ext/intl/collator/collator_create.c does not check type of its parameter: if( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s", &locale, &locale_len ) == FAILURE ) /* ... */ if(locale_len == 0) { locale = intl_locale_get_default(TSRMLS_C); } So, for PHP, a NULL value as an empty string imply the default locale. Test script: --------------- ini_set('intl.default_locale', fr_CA); $coll = new Collator(''); var_dump( $coll->getLocale(Locale::VALID_LOCALE) ); Expected result: ---------------- string(4) "root" Actual result: -------------- string(5) "fr_FR"