ID:               29593
 Updated by:       [EMAIL PROTECTED]
 Reported By:      rafael dot lima at email dot com dot br
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Linux Gentoo
 PHP Version:      4.3.8
 New Comment:

No, there is no bug. 
To check it out, just change print_r() to var_dump() and you'll see
that there is still 1 string and 2 floats in the array.
print_r() uses your locale settings, while var_dump() prints variable
contents in it's original state, so 2-nd & 3-rd elements are changed in
the print_r() output. 
You can comment out line with setlocale() and it will work too.


Previous Comments:
------------------------------------------------------------------------

[2004-08-17 15:41:58] [EMAIL PROTECTED]

Oops. Wrong report.

------------------------------------------------------------------------

[2004-08-17 15:41:34] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Use var_dump($_POST); and you'll see that variables are on their
places. Debug you code.

------------------------------------------------------------------------

[2004-08-09 22:46:51] rafael dot lima at email dot com dot br

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 this bug report at http://bugs.php.net/?id=29593&edit=1

Reply via email to