Uppercase Booleans vs. Lowercase in PHP

后端 未结 11 1945
无人共我
无人共我 2020-12-23 02:33

When I was learning PHP, I read somewhere that you should always use the upper case versions of booleans, TRUE and FALSE, because the \"normal\" lo

11条回答
  •  囚心锁ツ
    2020-12-23 03:00

    Personally I've always used the lowercase form, but for no particular reason other than to make my code look tidy, the only place I use capital letters is when camel casing class names and variable names.

    One advantage to using uppercase that comes to mind though is that they stick out and are easy to find in code.

提交回复
热议问题