Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basic-syntax.xml Specify when it is better to skip closing PHP tags #4304

Closed
wants to merge 1 commit into from

Conversation

mmalferov
Copy link
Member

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

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
Comment on lines -56 to 59
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the file is not just PHP code the following sentence doesn't make any sense.

@mmalferov mmalferov closed this Dec 14, 2024
@mmalferov mmalferov deleted the patch-369028 branch January 20, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants