#29593 [NEW]: join() doesn't respect locale settings

From: Date: Mon, 09 Aug 2004 20:46:52 +0000
Subject: #29593 [NEW]: join() doesn't respect locale settings
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-64330@lists.php.net to get a copy of this message
From: rafael dot lima at email dot com dot br Operating system: Linux Gentoo PHP version: 4.3.8 PHP Bug Type: Scripting Engine problem Bug description: join() doesn't respect locale settings Description: ------------ When a use the join() function on an array that have a float value, the string returned contains the values formatted without the setlocale() settings Reproduce code: --------------- setlocale(LC_ALL,'pt_BR'); $x="10,01"; $a[1] = $x; $a[2] = floatval(str_replace(",",".",$x)); $a[3] = floatval('10.01'); echo '<pre>'; print_r($a); echo '</pre>'; $b = join("<br>",$a); echo ($b); Expected result: ---------------- Array ( [1] => 10,01 [2] => 10,01 [3] => 10,01 ) 10,01 10,01 10,01 Actual result: -------------- Array ( [1] => 10,01 [2] => 10,01 [3] => 10,01 ) 10,01 10.01 10.01 -- Edit bug report at http://bugs.php.net/?id=29593&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29593&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29593&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=29593&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29593&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29593&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29593&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29593&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=29593&r=support Expected behavior: http://bugs.php.net/fix.php?id=29593&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=29593&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=29593&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29593&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29593&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29593&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29593&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=29593&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29593&r=float

« previous php.bugs (#64330) next »