Does it have a performance impact? Yes. Simply because there is more text for the parser to parse. It must have an impact. And yes, it will have a measurable impact.

Does it have a meaningful impact? No. Not at all. You would be hard pressed to see any difference even if you had millions of them in your app. Yes, there will be more clock cycles used, but trivially...

The bigger thing is to note that the two pieces of code are not identical in general. PHP will strip a single new line after a closing ?> , but any other characters after ?> will render in the output. So trailing spaces or multiple newlines after ?> will be rendered directly.

So my suggestion is ignore the performance, write the correct and more readable code (the more semantically correct code). And ignore small performance differences...