#31026 [NoF->Opn]: Problem with type conversion

2004-12-17 Thread tobi at knmm dot de
 ID:   31026
 User updated by:  tobi at knmm dot de
 Reported By:  tobi at knmm dot de
-Status:   No Feedback
+Status:   Open
 Bug Type: Variables related
 Operating System: Linux 2.6.8 (Debian sarge)
-PHP Version:  4.3.9
+PHP Version:  4.3.10RC3-dev
 New Comment:

Now, with the CVS version the script says '34,9' instead of 34.9 (with
4.3.9 it was only '34').
This solves my problem, which was that calculations with variables,
type-converted from string to float had gone wrong sometimes. 
But it's still very strange.
I figured out that the problem only occurrs if the apache webserver
with php on it already ran for a few hours.


Previous Comments:


[2004-12-16 01:00:02] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



[2004-12-08 21:37:43] [EMAIL PROTECTED]

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

--------

[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


#31026 [NEW]: Problem with type conversion

2004-12-08 Thread tobi at knmm dot de
From: tobi at knmm dot de
Operating system: Linux 2.6.8 (Debian sarge)
PHP version:  4.3.9
PHP Bug Type: Variables related
Bug description:  Problem with type conversion

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 bug report at http://bugs.php.net/?id=31026&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=31026&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=31026&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=31026&r=trysnapshot51
Fixed in CVS:http://bugs.php.net/fix.php?id=31026&r=fixedcvs
Fixed in release:http://bugs.php.net/fix.php?id=31026&r=alreadyfixed
Need backtrace:  http://bugs.php.net/fix.php?id=31026&r=needtrace
Need Reproduce Script:   http://bugs.php.net/fix.php?id=31026&r=needscript
Try newer version:   http://bugs.php.net/fix.php?id=31026&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31026&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=31026&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=31026&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=31026&r=submittedtwice
register_globals:http://bugs.php.net/fix.php?id=31026&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=31026&r=php3
Daylight Savings:http://bugs.php.net/fix.php?id=31026&r=dst
IIS Stability:   http://bugs.php.net/fix.php?id=31026&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31026&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=31026&r=float
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=31026&r=mysqlcfg