Bug #65230 [Com]: setting locale randomly broken

From: Date: Thu, 27 Mar 2014 12:10:32 +0000
Subject: Bug #65230 [Com]: setting locale randomly broken
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184922@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65230&edit=1 ID: 65230 Comment by: cpuidle at gmx dot de Reported by: xrstf-misc at yahoo dot com Summary: setting locale randomly broken Status: Wont fix Type: Bug Package: *General Issues Operating System: Windows 7 x64 PHP Version: 5.5.0 Block user comment: N Private report: N New Comment: > You should really really rely on intl's NumberFormatter, way better and portable. That's all fine. The problem is that even the "internal" type casts like (string)3.1 honor the non-working locales. Either it gets a big warning in the docs or the default casting behaviour should be changed as it's borked anyway. Honestly (my 5c)- and even more so since it did apparently work before 5.3- it is one of the cases where PHP behaves entirely unpredictable from developer's perspective. Previous Comments: ------------------------------------------------------------------------ [2014-03-27 11:13:15] pajoye@php.net It is somehow, not portable, not thread safe, etc. You should really really rely on intl's NumberFormatter, way better and portable. ------------------------------------------------------------------------ [2014-03-27 10:18:19] cpuidle at gmx dot de It would at least help if the behavior was properly documented in setlocale... ------------------------------------------------------------------------ [2014-03-27 09:54:22] ab@php.net Related To: Bug #66962 ------------------------------------------------------------------------ [2013-08-02 16:47:23] ab@php.net And after all, locale has such issues on any platform. The solution is to use intl or custom localization functionality. ------------------------------------------------------------------------ [2013-07-30 15:54:08] ab@php.net This isnt 5.5 issue only, you can find it in any PHP version starting with 5.3. localeconv() isnt thread safe and using it with _configthreadlocale() might lead to unpredictable results. That's why bug #63688 was marked "won't fix" - a solution, if any, might be very tricky. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=65230 -- Edit this bug report at https://bugs.php.net/bug.php?id=65230&edit=1

« previous php.bugs (#184922) next »