0

Possible Duplicate:
What does “===” mean?

i am seeing === often in php statements, but don't know what it mean. e.g if ($pwd === PwdHash($pass,substr($pwd,0,9))). thanks

Community
  • 1
  • 1
geeksalah
  • 51
  • 6
  • @rdlowrey: that is an auto-generated comment that appears when a vote to close is claiming the question as a duplicate. – sberry Jan 18 '12 at 06:26

2 Answers2

2

It tests equality, but unlike == it requires that the two operands be of the same type as well as value.

For instance, "1" == 1 will be true, but "1" === 1 is false because the type is different.

Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592
  • 1
    The important point is not that `===` requires same type, but `==` actually attempts to perform **type casting** to make them `===`. – jondavidjohn Jan 18 '12 at 06:22
  • PHP's documentation on "Type Juggling" gets into more detail about its type system and casting (http://php.net/manual/en/language.types.type-juggling.php) – Lachlan McDonald Jan 18 '12 at 06:32
-1

php has two types of equal comparison operator == and ===

== check for the equalization but not strict mean it will return true for ('123'==123)

=== is a strict equal operator it will return false for the ('123'===123)

read more about these from here

Dau
  • 8,578
  • 4
  • 23
  • 48