I have reproduced this bug, but after changed some setting: change the "precision" and "serialize_precision" setting in php.ini, and even changed back, or maybe after i added the printf("%.2f\n",$v2), the echo $v2 is correctted, but the printf result is always 16.:
finally, i wrote such a script:
for ($i=0; $i<400; $i++)
{
echo $i."-";
printf("%f\n",$i);
}
and found there're 8 number have this bug, they are:
17
19
29
39
170
190
290
390
Hello
I downloaded PHP4Delphi 7.2 + PHP5.2.13.13.
I wrote simple script:**
<?php
$v1 = 16.00;
echo $v1."\n";
$v2 = 17.00;
echo $v2."\n";
$v3 = 18.00;
echo $v3."\n";**
?>
when I run it using php common line (php cli) program , I receive:
16
17
18
When I run the script using one of demos(Demos\psvPHP\console\phpcon), I receive:
16
16:
18
As you notice I get 2 different results. could you tell me where I'm wrong? PHP.INC is ok.
When I use version php 5.3.2 to run my script both results are the same. Unfortunately I am to use 5.2.
I have reproduced this bug, but after changed some setting: change the "precision" and "serialize_precision" setting in php.ini, and even changed back, or maybe after i added the printf("%.2f\n",$v2), the echo $v2 is correctted, but the printf result is always 16.:
finally, i wrote such a script:
for ($i=0; $i<400; $i++)
{
echo $i."-";
printf("%f\n",$i);
}
and found there're 8 number have this bug, they are:
17
19
29
39
170
190
290
390
I guess this is a php bug, here's a php bug report about this:
http://bugs.php.net/bug.php?id=47304
Thank you for the info you gave me. It was very useful for me. I was testing many versions of PHP, and PHP 5.2.6 was the first wich works ok.