php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35050 Capital "I" letters in func/class method names do not work with turkish locale
Submitted: 2005-11-01 14:45 UTC Modified: 2007-09-06 11:22 UTC
Votes:45
Avg. Score:4.2 ± 1.2
Reproduced:28 of 31 (90.3%)
Same Version:11 (39.3%)
Same OS:14 (50.0%)
From: satanistlav at mail dot ru Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 5CVS-2005-11-01 (cvs) OS: Linux
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-11-01 14:45 UTC] satanistlav at mail dot ru
Description:
------------
The Linux hosting server I use recently upgraded PHP Version to 5.0.4. After upgrade all function and and class methods those had capital "I" letter in the function names became unrecognized by PHP. No such problem I had in previouse version of PHP, and no problem in my local server (WinXP, Apache 2, PHP v5.0.5)

Reproduce code:
---------------
//Part of mail class
.....
/**
     * Sets Mailer to send message using SMTP.
     * @return void
     */
   function IsSMTP() {
       $this->Mailer = "smtp";
   }

    /**
     * Sets Mailer to send message using PHP mail() function.
     * @return void
     */
    function IsMail() {
        $this->Mailer = "mail";
    }
.....
/*********  I used class methods *******************/
 .....
 $mailer->IsHtml(true);
 $mailer->IsMail();
 .....

Expected result:
----------------
Execution of class method is expected

Actual result:
--------------
/********* I got error ********************/
Fatal error: Call to undefined method PHPMailer::IsHtml() in .... 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-01 14:57 UTC] derick@php.net
What is your locale set to? Can you provide a link to phpinfo() output?
 [2005-11-01 15:02 UTC] satanistlav at mail dot ru
http://www.yda.com.tr/info.php
 [2005-11-01 15:12 UTC] derick@php.net
I can reproduce this with the following short script:

<?php
class foo
{
    function IsHere()
    {
        echo "here\n";
    }
}

echo setlocale(LC_ALL, 'tr_TR'), "\n";

$f = new foo();
$f->IsHere();
?>

(You need to have the tr_TR locale installed for this).

It does work properly with PHP 5.1 actually, and it has to to with the zend_str_tolower() function which uses the tolower() libc call, which uses the locale. As in Turkish the I does not lowercase to i you can get weird things. This is why we should get rid of case insensitive function names.

It also works with normal function names (instead of classes' methods)

 [2005-11-01 15:14 UTC] satanistlav at mail dot ru
I have multilingual site. Locales are set to en_US.ISO-8859-1 in Enlgish side of the site and tr_TR.ISO-8859-9 in Turkish for LC_ALL
 [2005-11-01 15:17 UTC] satanistlav at mail dot ru
I have uploaded your code to the server and I still have the same error! http://www.yda.com.tr/test.php
 [2005-11-15 13:39 UTC] derick@php.net
We discussed it and this will not be addressed in PHP 5, but only from PHP 6 and higher. Please make sure your set the correct locale before starting the script - or before including files that define elements that contain upper case I's.
 [2007-09-06 11:22 UTC] jani@php.net
Patch by Tomas Kuliavas:
http://www.topolis.lt/php/#35050

 [2010-04-16 19:38 UTC] sweiss at stylesight dot com
Requesting a fix for this... this has been going on for almost 5 years, yet the 
proper fix for the problem also only takes that many lines of code, according to 
a different bug report, which was rejected on a technicality.   The "workaround" 
suggested means that none of my turkish is capitalized correctly.  This is 
really not going over well.  Please, please, please, at least make the fix 
listed in Bug #35050 an option that we can set in the php.ini or ideally with 
ini_set or *something*, if it causes problems for other programmers, and if it 
doesn't, can it just be fixed already?  It is not going to be pretty when I have 
to go tell them that the turkish translation they've made is going to be 
permanently crippled until PHP 6 is released, and our code is updated to support 
it... and it looks like PHP 6 just went back to square one so this could be 
quite a long time.
 [2011-11-06 19:51 UTC] gerd dot katzenbeisser at gmail dot com
This Bug is a duplicate of 
Bug #18556
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 02:02:10 2014 UTC