[doc-en] master: basic-syntax.xml Specify when it is better to skip closing PHP tags (#4304)
| From: | Mikhail Alferov via GitHub | Date: | Thu, 24 Apr 2025 14:47:14 +0000 |
| Subject: | [doc-en] master: basic-syntax.xml Specify when it is better to skip closing PHP tags (#4304) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-22640@lists.php.net to get a copy of this message | ||
Author: Mikhail Alferov (mmalferov)
Committer: GitHub (web-flow)
Pusher: vrana
Date: 2025-04-24T16:36:59+02:00
Commit: https://github.com/php/doc-en/commit/0e618211e53c66f33762be225a4d57c08ef4b2f7
Raw diff: https://github.com/php/doc-en/commit/0e618211e53c66f33762be225a4d57c08ef4b2f7.diff
basic-syntax.xml Specify when it is better to skip closing PHP tags (#4304)
It seemed to me that limiting the skipping of closing PHP tags to only files that contain only PHP
code is misleading. After all, we skip closing tags in files with mixed content too, and the
condition for skipping is not whether the file consists only of PHP code, but whether the file ends
with PHP code
Changed paths:
M language/basic-syntax.xml
Diff:
diff --git a/language/basic-syntax.xml b/language/basic-syntax.xml
index c685c8161915..07c7c222e72c 100644
--- a/language/basic-syntax.xml
+++ b/language/basic-syntax.xml
@@ -57,7 +57,7 @@
</para>
<para>
- If a file contains only PHP code, it is preferable to omit the PHP closing tag
+ If a file ends with PHP code, it is preferable to omit the PHP closing tag
at the end of the file. This prevents accidental whitespace or new lines
being added after the PHP closing tag, which may cause unwanted effects
because PHP will start output buffering when there is no intention from