Bug #68203 [NEW]: implode() for foat numbers use setlocale() settings!

From: Date: Thu, 09 Oct 2014 22:54:23 +0000
Subject: Bug #68203 [NEW]: implode() for foat numbers use setlocale() settings!
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187993@lists.php.net to get a copy of this message
From: i dot am dot brutto at gmail dot com Operating system: Ubuntu PHP version: 5.5.17 Package: Strings related Bug Type: Bug Bug description:implode() for foat numbers use setlocale() settings! Description: ------------ --- From manual page: http://www.php.net/function.implode --- There is no any information aboout this strange behavior. =\ Detect this was difficult enough because do not expect problems in such simple core things. It's the same bug (https://bugs.php.net/bug.php?id=17815), but it dodn't fixed (as there marked). Test script: --------------- <?php $locale = 'ru_RU'; putenv("LANG=$locale" . '.UTF-8'); putenv("LANGUAGE=$locale" . '.UTF-8'); setlocale(LC_ALL, $locale . '.UTF-8'); // . '.UTF-8' $arr = array(12.12,12,23,21.44,67.88); print_r(implode(',', $arr)); Expected result: ---------------- there is no logic. other string functions not affected with this. and nowhere information about it. $arr = array(12.12,12,23,21.44,67.88); print_r(implode(' | ', $arr)); expected => 12.12 | 12 | 23 | 21.44 | 67.88 current => 12,12 | 12 | 23 | 21,44 | 67,88 (setlocale to ru_RU for example) -- Edit bug report at https://bugs.php.net/bug.php?id=68203&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68203&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68203&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68203&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=68203&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=68203&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=68203&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=68203&r=needscript Try newer version: https://bugs.php.net/fix.php?id=68203&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=68203&r=support Expected behavior: https://bugs.php.net/fix.php?id=68203&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=68203&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=68203&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=68203&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68203&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=68203&r=dst IIS Stability: https://bugs.php.net/fix.php?id=68203&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=68203&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=68203&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=68203&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=68203&r=mysqlcfg

« previous php.bugs (#187993) next »