PHP Alternative Control Structures, any drawbacks?

后端 未结 5 1050
天涯浪人
天涯浪人 2021-01-21 02:14

I\'ve been working with PHP code that generates HTML without any templating, and it\'s quite spaghetti and difficult to read with the way they\'ve structured it. On

5条回答
  •  滥情空心
    2021-01-21 02:50

    Personally, I detest them, but they're part of the language. They haven't been deprecated and I doubt they'll be removed anytime soon.

    The thing you have to be careful about is that you can't mix the two syntaxes in the same control block (as the manual page says).

    I don't find them any more readable. Identation gives enough clue. If you have blocks long enough that you see yourself using these control structures or } //end of while, you should refactor your code.

提交回复
热议问题