|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2013-11-17 18:41 UTC] t dot baumgarden at web dot de
 Description: ------------ Hi. The (same?) bug was closed long time before here: https://bugs.php.net/bug.php?id=18556 Now its back in php 5.5.6. Write setlocale(LC_ALL, 'tr_TR.UTF-8'); I get: constant(): Couldn't find constant test::PRODUCTiON and complete page is broken. See "i" in "PRODUCTiON". Change 'tr_TR.UTF-8' to another string like 'en_US.UTF-8' now its working fine. Test script: --------------- class test { const PRODUCTION = 20; public static $environment = 10; } test::$environment = constant('test::'.strtoupper('production')); echo (test::$environment); Expected result: ---------------- 20 Actual result: -------------- Error message: constant(): Couldn't find constant test::PRODUCTiON PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 07:00:01 2025 UTC | 
In short: setlocale(LC_ALL, 'tr_TR.UTF-8'); echo strtoupper('production'); Result: "PRODUCTiON" with wrong "i"I think this bug also affects preg_match() function while using the case insensitive match modifier. Seems only letter 'i' has the problem. See example below: <?php setlocale(LC_ALL, 'tr_TR.UTF-8'); var_dump(preg_match('/I/i', 'production')); // output: no match found (WRONG) var_dump(preg_match('/O/i', 'production')); // output: one match found (correct)You are right in PHP 5.3 (tested with online php) But in PHP 5.6.3 (I acutal use) this bug is gone and all working fine. setlocale(LC_ALL, 'tr_TR.UTF-8'); echo strtoupper('production'); show me "PRODUCTION" and not what you said "PRODUCTİON". Why in PHP 5.6.3 this now working with "strtoupper"? In PHP 5.3 its working only with "mb_strtoupper".