The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

If I'm not mistaken, that has to do with type conversion.
When two (or more) values of different types are compared (e.g. (0=='')), they get converted to booleans. Every datatype has another way of converting to a boolean, every non-empty string for instance always evaluates to true.

In other words, since NULL always gets converted to Boolean FALSE, you're comparing (false == false) in every evaluation.

Not true. Using "=="; 0, null, false, and an empty string all evaluate to being equal.

They evaluate to being equal because of implicit type casting in PHP, yet they are not equal. So when WebNoob said 0 and NULL are not equal, he is correct. if a variable is NULL, it doesn't exist in PHP's symbol table (in effect, they do not exist at all), while 0 , FALSE, and empty string do.

If you think 0 and FALSE are equivalent (because '==' shows them equal), you are looking for trouble. Certain functions would give you unexpected results if you rely on this logic.

Woa buddy let's put it in context. I'm sure you learned about "context" in school... god I hope so, but it seems maybe not.

are 0, false, and null equivalent?

(0 == false and false == null and 0 == null).

YES, they're equivalent, so stop all the ******** already

Dude! Show some respect, everybody has their right to say what they feel is correct, hence why the forum is as big as it is and why questions get answered as quick as they do. Maybe you need refreshing on the forum rules..here is the link for you CLICK
I suggest you read the part specifically on "Don't attack each other" about half way down the page.

However, $b===null is true even if $b is not set. So virtually you can say they are identical, at least as data types.

That statement itself is enough to actually create $b and set it to null since that is the effect of referencing $b in the code for the first time anyway. By the time it gets to the comparison $b does exiist and is equal to null and therefore the condition is true when the test takes place even though it wan't before that statement was reached.

That statement itself is enough to actually create $b and set it to null since that is the effect of referencing $b in the code for the first time anyway.

Stephen, let me correct you there.

Implicit variable creation only takes place if variable is on the left side of the assignment, or is passed by reference. Comparison operators never create variables, so "$undef === null" will still raise a notice.