You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class Main {
static function main() {
var f:Float = 0;
var i:Float = 0.0;
trace(i == f); // false
}
}
genphp tries to be smart by determining that the operand types are equal and thus being able to use ===, which evaluates to false. Note that it could not use == either because that would give incorrect equality results when null is involved. This is somewhat problematic because it would mean we have to go a slow equality route for every numeric equality check.
We can try to detect the original assignment of 0 to Float and convert it at run-time, but I have no idea if PHP is going to play along.
The text was updated successfully, but these errors were encountered:
Such approach will not cover floats which come from dynamics (json, external php code, native functions). While current fix works for any case with the least possible overhead.
genphp tries to be smart by determining that the operand types are equal and thus being able to use
===
, which evaluates tofalse
. Note that it could not use==
either because that would give incorrect equality results whennull
is involved. This is somewhat problematic because it would mean we have to go a slow equality route for every numeric equality check.We can try to detect the original assignment of
0
to Float and convert it at run-time, but I have no idea if PHP is going to play along.The text was updated successfully, but these errors were encountered: