-4

Possible Duplicate:
What's the difference between is_null($var) and ($var === null)?

Is there any difference between following code:

if(is_null($x)) { ...

and

if($x===null) { ...
4

1 回答 1

2

Yes. == is a loose comparison, meaning a lot more than just NULL will result in true in the second version. See the type comparison tables.

于 2012-04-29T06:18:25.457 回答