|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-02-15 08:30 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 13:00:02 2025 UTC |
Description: ------------ trying to save a decimal number in a session value Run badsave.php to store a value. Seems to recall it ok within that scripts. Running badrecall.php retrieves some other number. the test number here 127.27 returns 72.035156309605 most other numbers ok, in quotes its ok. Reproduce code: --------------- <? /*badsave.php*/ session_start(); $n=127.27; store($n); recall(); function store($n=0){ echo "saving $n"; $_SESSION["badno"]=$n; } function recall(){ session_start(); $n=$_SESSION["badno"]; echo "<br>recall $n"; } ?> <? /*badrecall.php*/ session_start(); $n=$_SESSION["badno"]; echo "<br>recall $n"; ?> Expected result: ---------------- just echo 127.27 to the screen Actual result: -------------- echo returned 72.035156309605 instead.