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

前端 未结 5 1753
耶瑟儿~
耶瑟儿~ 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:55

    They are both exactly equivalent. Consult your organization's style guide to determine which you should use.

提交回复
热议问题