#31026 [Opn->Fbk]: Problem with type conversion
| From: | derick@php.net | Date: | Wed, 08 Dec 2004 20:37:44 +0000 |
| Subject: | #31026 [Opn->Fbk]: Problem with type conversion | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-69944@lists.php.net to get a copy of this message | ||
ID: 31026
Updated by: derick@php.net
Reported By: tobi at knmm dot de
-Status: Open
+Status: Feedback
Bug Type: Variables related
Operating System: Linux 2.6.8 (Debian sarge)
PHP Version: 4.3.9
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:
------------------------------------------------------------------------
[2004-12-08 20:37:49] tobi at knmm dot de
Description:
------------
A very strange problem occurs on my webserver. If you run the provided
code via http://knmm.de/bug.php a few times, in about 1 out of
10 times
the second line of output is "$price is a double with value 34". This
shows up randomly.
Running the script on the commandline of the same machine doesn't show
this behaviour.
--
Tobi
Reproduce code:
---------------
$price = '34.90';
echo "\$price is a ".gettype($price)." with value $price\n";
settype($price,'double');
echo "\$price is a ".gettype($price)." with value $price\n";
(also available via http://knmm.de/bug.phps)
Expected result:
----------------
$price is a string with value 34.90
$price is a double with value 34.9
Actual result:
--------------
$price is a string with value 34.90
$price is a double with value 34
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31026&edit=1