Curly braces or colon-endif statements in PHP - which one provides better performance and code compatibility?

前端 未结 5 1775
耶瑟儿~
耶瑟儿~ 2021-01-07 22:03

I was looking through many snippets of code, and I have found that people can use the following two methods in an if statement:

Method 1:



        
5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-07 22:32

    As I've seen until now, in my app, there is no difference between them, but you can have a lot of problem if you'll mixt them without a rule because it's possible to get some errors and you will search a curly but you have not used curly. Choose one syntax an use exclusive.

提交回复
热议问题