29 lines
1.1 KiB
XML
29 lines
1.1 KiB
XML
|
<documentation title="Closing comments instead of PHP closing tag">
|
||
|
<standard>
|
||
|
<![CDATA[
|
||
|
The PHP closing tag on a PHP document ?> is optional to the PHP parser. However, if used, any whitespace following the closing tag, whether introduced by the developer, user, or an FTP application, can cause unwanted output, PHP errors, or if the latter are suppressed, blank pages. For this reason, all PHP files should OMIT the closing PHP tag, and instead use a comment block to mark the end of file and it's location relative to the application root. This allows you to still identify a file as being complete and not truncated.
|
||
|
]]>
|
||
|
</standard>
|
||
|
<code_comparison>
|
||
|
<code title="Examples of valid closing comments">
|
||
|
<![CDATA[
|
||
|
<?php
|
||
|
|
||
|
echo "Here's my code!";
|
||
|
|
||
|
/* End of file myfile.php */
|
||
|
/* Location: ./system/modules/mymodule/myfile.php */
|
||
|
]]>
|
||
|
</code>
|
||
|
<code title="Examples of invalid closing comments">
|
||
|
<![CDATA[
|
||
|
<?php
|
||
|
|
||
|
echo "Here's my code!";
|
||
|
|
||
|
?>
|
||
|
]]>
|
||
|
</code>
|
||
|
</code_comparison>
|
||
|
</documentation>
|