Solved Is the closing PHP bracket required?

LPH

Flight Director
Staff member
Self Reported Skill Level
3.00 star(s)
The opening PHP tag is <?php and belongs at the top of a PHP page; however, the closing tag ?> is not included in the ending of the file which is pure PHP.

From the PHP Manual:
If a file is pure PHP code, it is preferable to omit the PHP closing tag at the end of the file.

According to the PSR-2 Coding Style:
All PHP files MUST use the Unix LF (linefeed) line ending.

All PHP files MUST end with a single blank line.

The closing ?> tag MUST be omitted from files containing only PHP.
 
Top