From: tokul at users dot sourceforge dot net Operating system: Linux Debian Etch PHP version: 5CVS-2007-09-03 (snap) PHP Bug Type: Scripting Engine problem Bug description: Broken classes and method names in Turkish locale
Description: ------------ PHP zend_str_tolower() is locale insensitive on Windows and locale (LC_CTYPE) sensitive on other platforms. It causes case sensitivity problems in class and method names with Turkish locale on Linux, because Turkish locale has case sensitivity rules that differ from US English rules. Programmers make mistake by assuming that Latin small letter i is always equal to Latin capital letter i. Issue can be fixed by writing tolower() function alternative that is not LC_CTYPE sensitive. My tests show that if zend_str_tolower() is modified to do locale insensitive case conversion, basic PHP install passes 'make test' without any additional issues and Zend/bench.php does not show performance decrease. My code modifications are based on program licensed under GPL. locale insensitive tolower() takes only 5 lines in C. I can post link to patch, if you can use GPL code. If you can't do that, I can explain your programmers how locale insensitive tolower() works and you can write own function. I know about 40086, 35583, 35050 and 18556 bug reports, but these bug reports are closed and it looks strange, if you don't fix the issue when interpreter works correctly on Windows and BSD and fix takes less than 10 lines. Tested PHP 5.2-200709030430 and PHP6-200709030430 (unicode.semantics = off) snapshot. PHP6-200709030430 with unicode.semantics=on is not affected. If you have other open bug report on this issue, please give its number. Reproduce code: --------------- class TestIt { } class testclass2 { function TestItToo() {} } var_dump(setlocale(LC_ALL,'tr_TR.UTF-8')); var_dump(class_exists('TestIt')); $TestObj = new testclass2(); var_dump(method_exists($TestObj,'TestItToo')); Expected result: ---------------- string(11) "tr_TR.UTF-8" bool(true) bool(true) Actual result: -------------- string(11) "tr_TR.UTF-8" bool(false) bool(false) -- Edit bug report at http://bugs.php.net/?id=42526&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42526&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42526&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42526&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42526&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42526&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42526&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42526&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42526&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42526&r=support Expected behavior: http://bugs.php.net/fix.php?id=42526&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42526&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42526&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42526&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42526&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42526&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42526&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42526&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42526&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42526&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42526&r=mysqlcfg