What is a reason of placing boolean or null before comparison operator?

前端 未结 3 1452
刺人心
刺人心 2020-12-11 17:30

In PHP, what is an underlying reason of placing either boolean or null before identical comparison operator?

false === $value;   
null === $value;

3条回答
  •  情书的邮戳
    2020-12-11 17:49

    It's supposed to be quicker, but I can't lay a hand on an authority saying this with a simple Google search. See:

    http://forums.phpfreaks.com/topic/222939-is-there-a-difference-between-ifvar-false-and-iffalse-var/

    for one opinion.

提交回复
热议问题