Just out of curiosity (and a bit of necessity):
JavaScript
x
if(! is_null($var)){
//do something
}
Is the above statement the same as
JavaScript
if($var != NULL){
//do something
}
Advertisement
Answer
No they are not the same.
The is_null
function compairs the type also.
Example:
JavaScript
var_dump(is_null(0)); // bool(false)
var_dump(0 == NULL); // bool(true)
var_dump(0 === NULL); // bool(false)
So in your case
JavaScript
if(! is_null($var)){
//do something
}
Would be the same as
JavaScript
if($var !== NULL){
//do something
}