Oh dear.

  • PHP is designed to manipulate HTML.
  • Therefore PHP is designed to output in the first place.
  • Outputting via echo() destroys readability of the HTML.
  • You cannot easily distinguish between logic, and presentation.
  • Putting HTML in string literals kills any hope of syntax checking/colouring in editors.
  • Attribute quotes need to be escaped (depending on the type of string you use).
  • Closing PHP tags is quick, because all the HTML code can be skipped by the PHP parser until it reaches another opening PHP tag. Strings must be parsed for escape sequences, and, in the case of double-quoted strings, variables.


I am sure there are more reasons, those are just off the top of my head right now.

See, I could write a book on elephant sphincters but that doesn't make me an expert on the subject.