Bug #18556 [Csd]: Setting locale to 'tr_TR' lowercases class names
| From: | nikic@php.net | Date: | Sat, 16 Apr 2016 12:30:21 +0000 |
| Subject: | Bug #18556 [Csd]: Setting locale to 'tr_TR' lowercases class names | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-200588@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=18556&edit=1
ID: 18556
Updated by: nikic@php.net
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:
@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.
Previous Comments:
------------------------------------------------------------------------
[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!
------------------------------------------------------------------------
[2016-04-15 23:22:56] nikic@php.net
@necmettin: Which PHP version are you using? Does this only happen if the twig extension is loaded?
@marcin: Do you see this issue with the reproduce script from the initial report, or with some other
code?
------------------------------------------------------------------------
[2016-04-15 22:56:45] necmettin dot begiter at gmail dot com
I'm having a problem that I believe is a side-effect of this issue.
I'm using the Twig extension in a project, and it uses the IteratorAggregate interface.
When the locale is tr_TR, I get
Fatal error: Interface 'IteratorAggregate' not found in ..
When I do setlocale('en_US.UTF-8') or 'es_ES.UTF-8', everything works fine.
I can provide the PHP compilation command line but the IteratorAggregate interface is built-in, so I
assume it would be practically impossible to remove the interface during the compilation process.
------------------------------------------------------------------------
[2016-03-11 12:01:12] marcin dot filip at gmail dot com
Hi this bug is still exists in new php versions. We have same problem with php version 5.6.18 and
from your comments should be fixed in 5.5 but it isn't. Question is why change locale is
affecting interpreter matching method which should be independend from locale. And stable in any
case. So some one can tell me when this problem will be solved because for multi language solution
using locale as language settings and in some cases use the data formatting unique by country. Or
maybe you can provide some information how to omit that error or some fix for that (maybe patch)
------------------------------------------------------------------------
[2012-12-04 17:32:06] jpauli@php.net
So, to sum things up :
The bugs has only been fixed in 5.5 branch. It mainly uses a char map to lower
characters instead of relying on locale-aware (possibly buggy versions) system's
libc.
You can find details with internal zend functions affected directly by reading
the source, here : http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_operators.c#45
------------------------------------------------------------------------
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