Is there any difference between this...
if (is_null($var)) {
do_something();
}
and this?
if ($var === null) {
do_something();
}
Which form is better when checking whether or not a variable contains null? Are there any edge cases I should be aware of? (I initialize all my variables, so nonexistent variables are not a problem.)
See Question&Answers more detail:os