Why is === faster than == in PHP?

前端 未结 12 929
有刺的猬
有刺的猬 2020-12-12 10:39

Why is === faster than == in PHP?

12条回答
  •  臣服心动
    2020-12-12 11:30

    I don't really know if it's significantly faster, but === in most languages is a direct type comparison, while == will try to do type coercion if necessary/possible to gain a match.

提交回复
热议问题