should I put a semi-colon after a single PHP statement?

后端 未结 5 727
南笙
南笙 2021-01-07 20:13

e.g.

some html....

more html...

?

5条回答
  •  滥情空心
    2021-01-07 20:57

    I find that not doing so can:

    1. Break syntax highlighting in some editors / IDE (not critical, but annoying)
    2. Make code harder to maintain.

    So yes, I recommend doing so, unless you are sure short tags are fine for the server config in which case its not really relevant.

    When editing other people's stuff, I try to just follow the same style.

提交回复
热议问题