ID:               31699
 Updated by:       [EMAIL PROTECTED]
 Reported By:      bg at vibros-land dot net
-Status:           Open
+Status:           Feedback
 Bug Type:         Variables related
 Operating System: Linux x86 (Gentoo 2004.3)
 PHP Version:      4.3.10
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip




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

[2005-01-26 00:45:40] bg at vibros-land dot net

Description:
------------
When the locale is set to "fr_FR" or "[EMAIL PROTECTED]" and when we restore a
Float/Double saved on a session, we see the var was truncated by
restoring process.

1-Set locale to "fr_FR" or "[EMAIL PROTECTED]"
2-Start a session
2-Store a Float var in this session
3-End program
4-See the Session File directly : all is good !
5-Restore th session
6-See the var : wrong result !
7-See the Session File directly : all is wrong too !

Reproduce code:
---------------
<?php
setlocale(LC_ALL, "[EMAIL PROTECTED]", "fr_FR");
session_start();
print("<html><body>\n");
if (isset($_SESSION["float_pos"]) && isset($_SESSION["float_neg"])) {
        printf("Pos Float restored :
%01.2f<br/>\n",$_SESSION["float_pos"]);
        printf("Neg Float restored :
%01.2f<br/>\n",$_SESSION["float_neg"]);
} else {
        $_SESSION["float_pos"]=0.25;
        $_SESSION["float_neg"]=-9.33;
        printf("Pos Float set to
%01.2f<br/>\n",$_SESSION["float_pos"]);
        printf("Neg Float set to
%01.2f<br/>\n",$_SESSION["float_neg"]);
}
print("</body></html>\n");
?>


Expected result:
----------------
--- 1st Access ----
Pos Float set to 0,25
Neg Float set to -9,33

--- 2nd Access ----
Pos Float restored : 0,25
Neg Float restored : -9,33

Actual result:
--------------
--- 1st Access ----
Pos Float set to 0,25
Neg Float set to -9,33

--- 2nd Access ----
Pos Float restored : 0,00
Neg Float restored : -9,00


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


-- 
Edit this bug report at http://bugs.php.net/?id=31699&edit=1

Reply via email to