1.2.152. Close Tags Consistency¶
PHP scripts may omit the final closing tag.
This is a convention, used to avoid the infamous ‘headers already sent’ error message, that appears when a script with extra invisible spaces is included before actually emitting the headers.
The PHP manual recommends : “If a file is pure PHP code, it is preferable to omit the PHP closing tag at the end of the file.”. (See PHP Tags):
.. code-block:: php
<?php
class foo {
}
1.2.152.1. Connex PHP features¶
1.2.152.1.1. Specs¶
Short name |
Php/CloseTagsConsistency |
Rulesets |
|
Exakat since |
0.9.3 |
PHP Version |
All |
Severity |
|
Time To Fix |
|
Precision |
Very high |
Available in |