PHP 中 !== 和 != 有什么区别?
可能的重复:
php == 与 === 运算符
PHP 中的 !== 和 != 有什么区别?
Possible Duplicate:
php == vs === operator
What's the difference between !== and != in PHP?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
!==
是严格不等于,并且不进行类型转换!=
是不等于,在检查之前进行类型转换!==
is strict not equal and which does not do type conversion!=
is not equal which does type conversion before checking===
AND!==
检查比较的值是否具有相同的类型(例如:int、string 等)并且具有相同的值,而...
==
AND!=
仅比较值===
AND!==
checks if the values compared have the same type (eg: int, string, etc.) and have the same valuesWhile...
==
AND!=
only compares the values这是一个类型的事情。
!==
考虑其操作数的类型,而!=
则不考虑(隐式转换使第一个条件为 false)。It's a type thing.
!==
takes into account the types of its operands, while!=
does not (the implicit conversion makes the first conditional false).==
仅当值相等时才为 true。===
仅当值和类型相等时才为 true。==
is only true if the values are equal.===
is only true if the values and types are equal.三重相等还确保两个变量来自同一类型
the triple equal also make sure the two variable are from the same type
两者都是 比较运算符
Both are comparion operators