Jump to content

differences between !== and !=


chmpdog

Recommended Posts

!= means not equal. !== means not identical. See the manual on comparison operators.

 

Here's an example demonstrating the difference:

 

$var1 = false;
$var2 = 0;

if($var1 != $var2){
    // Won't get here because 0 == false (evaluates to)
}

if($var1 !== $var2){
    // Will get here because $var1 isn't identical to $var2
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.