Function lookup problem after calling setlocale(LC_ALL, "tr_TR")

Bug #338720 reported by Can Koy
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
php
Unknown
Unknown
php5 (Ubuntu)
Triaged
Undecided
Unassigned

Bug Description

Binary package hint: php5-cli

Ubuntu 8.10

php5-cli:
  Installed: 5.2.6-2ubuntu4.1
  Candidate: 5.2.6-2ubuntu4.1
  Version table:
 *** 5.2.6-2ubuntu4.1 0
        500 http://tr.archive.ubuntu.com intrepid-updates/main Packages
        500 http://security.ubuntu.com intrepid-security/main Packages
        100 /var/lib/dpkg/status
     5.2.6-2ubuntu4 0
        500 http://tr.archive.ubuntu.com intrepid/main Packages

Bug Details:
<?php
echo setlocale(LC_ALL, 'tr_TR')."\n";
HI5();
function HI5() { echo "Five!\n";}
?>
outputs the following:
---
tr_TR

Fatal error: Call to undefined function HI5() in...
---

Notes:
1. Make sure you have tr_TR locale installed, i.e. check the output of first echo statement.
2. The locale before executing the script must be different from tr_TR to repeat this case, e.g. en_US.utf-8

Revision history for this message
Andreas Olsson (andol) wrote :

I can kind of confirm this bug. Actually I can only confirm this error for certain function names. For example, try replace HI5() with foo(), and everything should work as expected.

From my limited testing I've only ran into this problem when the function name contains a capital I.

Not entirely sure if this is a bug in PHP. While generating the tr_TR locale I received the following errors:

root@pc13267v3:/var/lib/locales/supported.d# echo "tr_TR ISO-8859-1" >> local
root@pc13267v3:/var/lib/locales/supported.d# locale-gen
Generating locales...
  en_US.UTF-8... up-to-date
  sv_SE.UTF-8... up-to-date
  tr_TR.ISO-8859-1... /usr/share/i18n/locales/tr_TR:1477: LC_MESSAGES: unknown character in field `nostr'
/usr/share/i18n/locales/tr_TR:1510: LC_TIME: unknown character in field `day'
/usr/share/i18n/locales/tr_TR:1525: LC_TIME: unknown character in field `mon'
/usr/share/i18n/locales/tr_TR:1531: LC_TIME: unknown character in field `mon'
/usr/share/i18n/locales/tr_TR:1532: LC_TIME: unknown character in field `mon'
/usr/share/i18n/locales/tr_TR:1567: LC_NAME: unknown character in field `name_gen'
failed
Generation complete.
root@pc13267v3:/var/lib/locales/supported.d#

All of the above applies to current versions of Ubuntu 8.04, 8.10 and 9.04.

Changed in php5:
status: New → Confirmed
Revision history for this message
Andreas Olsson (andol) wrote :

I've now reported the locale issue in bug #343298. While I suspect that that might be the root cause, I'm not sure.

Revision history for this message
Andreas Olsson (andol) wrote :

Never mind that part about the tr_TR locale might be broken. That was simply user error from my part. Wasn't thinking and automatically used ISO-8859-1 where there obviously should have been ISO-8859-9.

Anyhow, I can still confirm the original bug report, providing there function name consists of a capital I.

Revision history for this message
Chuck Short (zulcss) wrote :

This is fixed for karmic now, Thanks for the bug report.

Regards
chuck

Changed in php5 (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Can Koy (cankoy) wrote :

Chuck,
are you guys just sweeping bug reports older than 6 months under the carpet? what fix? it's not fixed at all, it's there in Karmic.

Changed in php5 (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Can Koy (cankoy) wrote :
Revision history for this message
Chuck Short (zulcss) wrote :

This is fixed for lucid.

Regards
chuck

Changed in php5 (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Can Koy (cankoy) wrote :

You once more falsely state this bug is fixed, and I trash Ubuntu and be gone for good.
Maybe that's just what you want after all.

Changed in php5 (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
C de-Avillez (hggdh2) wrote :

@Can Koy: please follow the CoC (http://www.ubuntu.com/community/conduct), there is no need to be aggressive. You already know this is an upstream issue, hitting all PHP distributions.

Changed in php5 (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Seyfi (seyfi) wrote :

Hi,
I reported bug #988963 which was marked as duplicate of this one.
Actually, the test case reported here does not generate said error as of Php 5.3.0, that's why I opened a new report rather than continuing with this one. But, the root of this issue reported upstream at #18556 is still unresolved and affects classes, interfaces.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.