简体   繁体   English

为什么在Eclipse for PHP中使用“ true”和“ TRUE”?

[英]Why 'true' and 'TRUE' in Eclipse for PHP?

The Eclipse 'intellisense' for some methods in PHP files suggests true , looking like the PHP boolean literal, but for other methods suggests TRUE , which looks like a constant defined somewhere. Eclipse的PHP文件中某些方法的'intellisense'表示true ,类似于PHP布尔文字,而其他方法则表示TRUE ,它看起来像是在某处定义的常量。 What causes this? 是什么原因造成的?

I'm not sure what causes it, but both are equivalent. 我不确定是什么原因引起的,但是两者都是等效的。 According to the PHP docs: 根据PHP文档:

To specify a boolean literal, use the keywords TRUE or FALSE. 要指定布尔文字,请使用关键字TRUE或FALSE。 Both are case-insensitive. 两者都不区分大小写。

Were I to hazard a guess as to the cause, I would think it is just due to many additions to the Eclipse's 'Intellisense' over the years, with various programmers using their own personal preference. 如果我想对原因进行猜测,我想那是由于多年来Eclipse的“ Intellisense”增加了许多功能,各种程序员使用了自己的个人喜好。

If you want to follow the PSR-2 standard , they must be in lower case. 如果要遵循PSR-2标准 ,则必须使用小写字母。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM