php echo vs open&close tag

后端 未结 6 1093
清歌不尽
清歌不尽 2020-12-01 11:16

Just to clarify: The issues \"echo vs print\" and \"double quotes vs single quotes\" are perfectly understood, this is about another thing:

Are there any re

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 11:59

    The first is far more readable in my opinion, however, the second technically involves less parsing. Any speed advantage in that case would likely be minor and really meaningless without profiling.

    Premature Optimization is the root of all evil. Do what makes the code easiest to read and maintain. Efficiency takes a backseat to maintainability.

    see http://en.wikipedia.org/wiki/Optimization_%28computer_science%29#When_to_optimize for some good advice on the subject

提交回复
热议问题