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

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

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

12条回答
  •  粉色の甜心
    2020-12-12 11:35

    Because === doesn't need to coerce the operands to be of the same type before comparing them.

    I doubt the difference in speed is very much though. Under normal circumstances you should use whichever operator makes more sense.

提交回复
热议问题