[DOC-CVS] [doc-en] master: basic-syntax.xml Specify when it is better to skip closing PHP tags (#4304)

[email protected] (Mikhail Alferov via GitHub)
Newsgroups php.doc.cvs
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.