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

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

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

12条回答
  •  余生分开走
    2020-12-12 11:35

    Faster should not just be measured in direct execution time (direct performance tests are almost negligible in this case). That said, I would need to see a test involving iteration, or recursion, to really see if there is a significant, cumulative difference (when used in a realistic context). The testing and debugging time you will save when dealing with edge cases should be meaningful to you, also

提交回复
热议问题