What does “===” mean?

前端 未结 10 1504
一生所求
一生所求 2020-11-27 06:01

I\'ve noticed someone using the PHP operator === which I can\'t make sense out of. I\'ve tried it with a function, and it corresponds in crazy ways.

Wha

10条回答
  •  醉话见心
    2020-11-27 06:47

    http://www.php.net/ternary

    $a == $b Equal TRUE if $a is equal to $b, except for (True == -1) which is still True.

    $a === $b Identical TRUE if $a is equal to $b, and they are of the same type.

    > "5" == 5;
    True
    > "5" === 5;
    False
    

提交回复
热议问题