converting some doubles to strings yields trailing colon
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
php |
Invalid
|
Undecided
|
Unassigned | ||
php5 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: php5
1) Description: Ubuntu hardy (development branch), Release: 8.04
2) module php5, Version: 5.2.4-2ubuntu5
3) I expect any number, divided by 10 times itself, then converted to a string, to yield "0.1"
4) In this release, sometimes I get "0.0:" (yes, that's 0.0 with a trailing colon character)
Detailed repro steps:
I can reproduce this bug on 32-bit Hardy Heron's default PHP, running on VMWare, and have seen it on another user's non-VM setup.
Repro instructions:
$ php -v
PHP 5.2.4-2ubuntu5 with Suhosin-Patch 0.9.6.2 (cli) (built: Feb 27 2008 20:43:54)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
$ cat test.php
<?php
for ($d = 0.10; $d < 1; $d = $d + 0.1) print $d * 10 . " " . ($d / ($d * 10)) . "\n";
?>
1) Description: Ubuntu hardy (development branch), Release: 8.04
2) module php5, Version: 5.2.4-2ubuntu5
$ php test.php
1 0.1
2 0.1
3 0.1
4 0.1
5 0.1
6 0.0:
7 0.0:
8 0.1
9 0.0:
10 0.1
Observed: Iterations 6, 7, and 9 have the output "0.0:"
Expected: All of these should have the output "0.1"
Changed in php: | |
status: | New → Confirmed |
This bug does not present itself on my amd64 installation, but it is present on my i386 installation.