Fatal PHP error if class/interface name has letter 'I' and locale set to tr_TR.utf8

Bug #988963 reported by Seyfi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
php
Unknown
Unknown
php5 (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

Description: Ubuntu 11.10
Release: 11.10
php5-cli:
  Installed: 5.3.6-13ubuntu3.6
  Candidate: 5.3.6-13ubuntu3.6

Test case #1:
<?php
setlocale(LC_ALL, 'tr_TR.utf8') or exit("tr_TR locale needed to run this test".PHP_EOL);
class IClass { }
$inst = new IClass;
?>
produces the following:
PHP Fatal error: Class 'IClass' not found...

Test case #2:
<?php
setlocale(LC_ALL, 'tr_TR.utf8') or exit("tr_TR locale needed to run this test".PHP_EOL);
interface Intf { }
class MyClass implements Intf { }
?>
produces the following:
PHP Fatal error: Interface 'Intf' not found...

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

This is definitely a weird one. Not sure why the locale would cause that.

$ sudo locale-gen tr_TR.UTF-8
Generating locales...
  tr_TR.UTF-8... done
Generation complete.
$ php
<?php
setlocale(LC_ALL, 'tr_TR.utf8') or exit("tr_TR locale needed to run this test".PHP_EOL);
class IClass { }
$inst = new IClass;
PHP Fatal error: Class 'IClass' not found in - on line 4
$ apt-cache policy php5-cli
php5-cli:
  Installed: 5.3.10-1ubuntu3
  Candidate: 5.3.10-1ubuntu3
  Version table:
 *** 5.3.10-1ubuntu3 0
        500 http://mirrors.kernel.org/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status

Changed in php5 (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Ondřej Surý (ondrej) wrote :
Revision history for this message
Seyfi (seyfi) wrote :

Before 5.3, function names were affected by this bug too.
Some change in 5.3.0 fixed it for functions, now class and interface names are affected only.

Revision history for this message
Logan Rosen (logan) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This particular bug has already been reported and is a duplicate of bug 338720, so it is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Feel free to continue to report any other bugs you may find.

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

Other bug subscribers

Remote bug watches

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