In php === is the identical comparison operator i.e. checks if two variables have equal values and are of the same type. But why array("asdf") === array("asdf") returns true? I guess both of these create new arrays with same contents(please correct me if I am wrong).
为什么数组=== array在PHP中等于true?
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
3条回答 默认 最新
douzhou7656 2012-12-07 05:28关注Simple answer:
array("asdf") === array("asdf")returns true because the two arrays being compared:- have the same key/value pairs,
- each of the same types, and
- in the exact same order.
That's what
array() === array()means.Good Read
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报