Welcome Guest, Not a member yet? Register   Sign In
Why is this true?
#1

[eluser]Steven Ross[/eluser]
I traced a bug back to sth essentially like this:

Code:
$key = 0;
if ($key == "text") {
    echo "true";
} else {
    echo "false";
}

This evaluates to TRUE. I realize it may have to do with mixing types, but IMO it should still be FALSE. PHP thinks otherwise. Why?


Messages In This Thread
Why is this true? - by El Forum - 07-27-2010, 02:13 AM
Why is this true? - by El Forum - 07-27-2010, 02:21 AM
Why is this true? - by El Forum - 07-27-2010, 02:25 AM
Why is this true? - by El Forum - 07-27-2010, 05:38 AM
Why is this true? - by El Forum - 07-27-2010, 11:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB