Stefan Walk schrieb:
Richard Quadling schrieb:
On 12/04/2008, Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:
There is no bug here.  Please read:

 http://docs.sun.com/source/806-3568/ncg_goldberg.html

 -Rasmus

So, would I be right in thinking that the only time type-juggling is
100% successful is between strings and integers?

I suggest you read the page that Rasmus referred to. The effect has nothing to do with type conversions, it happens with pure float computations too.

For those curious about an example of this effect:
$a = 1.00001 + 0.79999;
$b = 1.8;
var_dump($a, $b, $a === $b);
=>
float(1.8)
float(1.8)
bool(true)

$a = 1.000001 + 0.799999;
$b = 1.8;
var_dump($a, $b, $a === $b);
=>
float(1.8)
float(1.8)
bool(false)

on my machine here.

- Chris

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to