PHP中NULL和NULL的区别

时间:2022-04-05 20:10:02

Is there a difference between NULL and null in PHP? Sometimes they seem to be interchangeable and sometimes not.

PHP中NULL和NULL有区别吗?有时它们似乎可以互换,有时则不能。

edit: for some reason when I read the documentation linked to in the answer (before posting this question) I read it as "case sensitive" instead of "case insensitive" which was the whole reason I posted this question in the first place...

编辑:由于某种原因,当我读到与答案相关的文档(在发布这个问题之前)时,我把它读成“区分大小写”而不是“区分大小写”,这就是我最初发布这个问题的原因……

2 个解决方案

#1


105  

Null is case insensitive.

零是不区分大小写。

From the documentation:

从文档:

There is only one value of type null, and that is the case-insensitive keyword NULL.

类型为null的值只有一个,即不区分大小写的关键字null。

#2


8  

There is no difference. Same type just its a case insensitive keyword. Same as True/False etc...

没有区别。同样的类型只是一个不敏感的关键字。一样的真/假等等……

#1


105  

Null is case insensitive.

零是不区分大小写。

From the documentation:

从文档:

There is only one value of type null, and that is the case-insensitive keyword NULL.

类型为null的值只有一个,即不区分大小写的关键字null。

#2


8  

There is no difference. Same type just its a case insensitive keyword. Same as True/False etc...

没有区别。同样的类型只是一个不敏感的关键字。一样的真/假等等……