[wp-trac] [WordPress Trac] #40039: Remove closing PHP tags from bundled themes

WordPress Trac noreply at wordpress.org
Mon Mar 6 01:04:39 UTC 2017


#40039: Remove closing PHP tags from bundled themes
---------------------------+------------------------------
 Reporter:  netweb         |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Bundled Theme  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  2nd-opinion    |     Focuses:
---------------------------+------------------------------
Description changed by netweb:

Old description:

> Previously in #12307 / r19712, #23505 / r28678, and #30534 / r34887
> closing PHP tags have been removed from PHP files and is now a
> [https://make.wordpress.org/core/handbook/best-practices/coding-
> standards/php/#remove-trailing-spaces documented coding standard]:
>
> > ''""Omitting the closing PHP tag at the end of a file is preferred. If
> you use the tag, make sure you remove trailing whitespace."''
>
> The [https://secure.php.net/manual/en/language.basic-syntax.phptags.php
> PHP manual states]:
> > ''"If a file is pure 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 the programmer to send any output at that point in the
> script."''
>
> * Themes that exclude closing PHP tags: Twenty Fourteen
> * Themes that include closing PHP tags: Twenty Ten, Eleven, Twelve,
> Thirteen, Fifteen, and Sixteen
>
> Should the closing PHP tags be removed from the above themes?
>
> Related: #bb3078

New description:

 Previously in #12307 / r19712, #23505 / r28678, and #30534 / r34887
 closing PHP tags have been removed from PHP files and is now a
 [https://make.wordpress.org/core/handbook/best-practices/coding-
 standards/php/#remove-trailing-spaces documented coding standard]:

 > ''""Omitting the closing PHP tag at the end of a file is preferred. If
 you use the tag, make sure you remove trailing whitespace."''

 The [https://secure.php.net/manual/en/language.basic-syntax.phptags.php
 PHP manual states]:
 > ''"If a file is pure 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 the programmer to send any output at that point in the script."''

 * Themes that exclude closing PHP tags: Twenty Fourteen and Twenty
 Seventeen
 * Themes that include closing PHP tags: Twenty Ten, Eleven, Twelve,
 Thirteen, Fifteen, and Sixteen

 Should the closing PHP tags be removed from the above themes?

 Related: #bb3078

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40039#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list