|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-01-26 01:03 UTC] iliaa@php.net
[2005-01-26 17:56 UTC] iliaa@php.net
[2005-01-26 19:29 UTC] bg at vibros-land dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 17:00:02 2025 UTC |
Description: ------------ When the locale is set to "fr_FR" or "fr_FR@euro" 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 "fr_FR@euro" 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, "fr_FR@euro", "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