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?
--
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
"Standing on the shoulders of some very clever giants!"
Richard Quadling schrieb:
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.
Regards,
Stefan
Stefan Walk schrieb:
Richard Quadling schrieb:
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