LMSouq
general-dev Open

Why would one omit the close tag?

JO
johnlemon
1 month ago
3 views
Problem Description
I keep reading it is poor practice to use the PHP close tag `?>` at the end of the file. The header problem seems irrelevant in the following context (and this is the only good argument so far): >Modern versions of PHP set the output_buffering flag in php.ini If output buffering is enabled, you can set HTTP headers and cookies after outputting HTML because the returned code is not sent to the browser immediately. Every good practice book and wiki starts with this 'rule' but nobody offers good reasons. **Is there another good reason to skip the ending PHP tag?**

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base