Edit report at https://bugs.php.net/bug.php?id=18556&edit=1
ID: 18556
Comment by: tolga dot korkunckaya at gmail dot com
Reported by: spud at nothingness dot org
Summary: Setting locale to 'tr_TR' lowercases class names
Status: Closed
Type: Bug
Package: Scripting Engine problem
Operating System: Linux (RedHat 7.2)
PHP Version: 5CVS, 4CVS (2005-10-04)
Assigned To: stas
Block user comment: N
Private report: N
New Comment:
The problem with the class names seems to be solved as of php version 7.2
However, the issue with lowercasing uppercase I (İ) and uppercasing lovercase i (ı) is still
problematic. I'll create a new issue about this.
Previous Comments:
------------------------------------------------------------------------
[2018-05-17 10:48:01] requinix@php.net
@klemen: Please be specific about what works and what does not. Example code would be nice.
Also, PHP 7.0 is not actively supported anymore so make sure the problem occurs in 7.1 and/or 7.2.
------------------------------------------------------------------------
[2018-05-17 10:43:55] klemen dot praznik at innovatif dot com
fyi it seems that this bug has resurfaced in PHP 7.x
PHP 7.0.27-0+deb9u1 (cli) (built: Jan 5 2018 13:51:52) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.27-0+deb9u1, Copyright (c) 1999-2017, by Zend Technologies
------------------------------------------------------------------------
[2016-04-29 14:59:17] marcin dot filip at gmail dot com
Code to test is:
$locales = array (
$language,
$language.'.UTF-8',
$language.'_'.strtoupper($language === 'en' ? 'us' : $language),
$language.'_'.strtoupper($language === 'en' ? 'us' :
$language).'.UTF-8'
);
putenv('LC_ALL='.$locale);
setlocale(LC_ALL, $locales);
setlocale(LC_CTYPE, 'en_US');
bindtextdomain('messages', APPPATH.DS.'locale');
textdomain('messages');
bind_textdomain_codeset('messages', 'UTF-8');
In this example when you will set $language to "tr" everything is working but you must set
LC_TYPE to en_US so in that moment we loose information about specific data from full locale data
like currency, money formmating for that specific country. For me personally it's not problem
but some of the coders that wish to use those features of local setting will be not able to do.
Because they will be not able to follow the locale specification. Any ideas about to make it strait
one like should be and have peaceful head? It is hard to isolate interpreter setting from global
one? To always match php code in same way? This is code from my test of setting locale. And result
are some if you will remove setting LC_TYPE to en_US you will end with wrong class names and than
autoloader is not finding classes because they end with bad names where i is not i and everything is
lowercased i names. I think you have same problem with this for long time and not provide proper
architecture of in!
terpreter to avoid change of crusial settings from php code level.
------------------------------------------------------------------------
[2016-04-16 12:30:11] nikic@php.net
@necmettin: Per the previous comments of stas and jpauli, this issue has been fixed in PHP 5.5 and
above only, so this issue persisting on 5.4 is to be expected.
------------------------------------------------------------------------
[2016-04-15 23:37:39] necmettin dot begiter at gmail dot com
@nikic sorry, php version is 5.4.27
Yes, when I do not load Twig extension, this specific error goes away
(only things dependent on Twig break, which has nothing to do with this bug).
If these change anything: PHP is running in Apache as FastCGI; Zend Engine 2.4.0, ionCube loader
v4.4.1.
I can also provide a phpinfo() url if needed.
Also note that the initial error reproduction code given by @spud @2002 does not reproduce. But the
<?php
echo setlocale(LC_ALL, "tr_TR.utf8")."\n";
foreach(get_declared_classes() as $class)
{
if(!class_exists($class))
echo "$class No Longer Exists!\n";
}
?>
code reproduces, and I get
tr_TR.utf8
DateInterval No Longer Exists!
DOMImplementationList No Longer Exists!
DOMImplementationSource No Longer Exists!
DOMImplementation No Longer Exists!
DOMProcessingInstruction No Longer Exists!
InvalidArgumentException No Longer Exists!
RecursiveIteratorIterator No Longer Exists!
IteratorIterator No Longer Exists!
FilterIterator No Longer Exists!
RecursiveFilterIterator No Longer Exists!
CallbackFilterIterator No Longer Exists!
RecursiveCallbackFilterIterator No Longer Exists!
ParentIterator No Longer Exists!
LimitIterator No Longer Exists!
CachingIterator No Longer Exists!
RecursiveCachingIterator No Longer Exists!
NoRewindIterator No Longer Exists!
AppendIterator No Longer Exists!
InfiniteIterator No Longer Exists!
RegexIterator No Longer Exists!
RecursiveRegexIterator No Longer Exists!
EmptyIterator No Longer Exists!
RecursiveTreeIterator No Longer Exists!
ArrayIterator No Longer Exists!
RecursiveArrayIterator No Longer Exists!
SplFileInfo No Longer Exists!
DirectoryIterator No Longer Exists!
FilesystemIterator No Longer Exists!
RecursiveDirectoryIterator No Longer Exists!
GlobIterator No Longer Exists!
MultipleIterator No Longer Exists!
IntlDateFormatter No Longer Exists!
__PHP_Incomplete_Class No Longer Exists!
PharFileInfo No Longer Exists!
SimpleXMLIterator No Longer Exists!
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=18556
--
Edit this bug report at https://bugs.php.net/bug.php?id=18556&edit=1