Jump to content

" === "?


The Praetorian

Recommended Posts

Hi..I think you probably know.. $a === $b Identical TRUE if $a is equal to $b, and they are of the same type. so it's make u to comparision strictly type matching and then put comparisionRegards,Vijay :)

Link to comment
Share on other sites

To clarify that, the == operator checks for value equivalence, and the === operator checks for value and type equivalence. With that, the two values are only equivalent if they are also the same data type. So the string "1" and the number 1 are not type equivalent (one is a string, one is a number).

$v1 = ("1" == 1 ? true : false); // true$v2 = ("1" === 1 ? true : false); // false$v3 = ("1" === "1" ? true : false); // true$v4 = (1 === 1 ? true : false); // true$v5 = (0 == false ? true : false); // true$v6 = (0 === false ? true : false); // false

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...