The closing tag of a PHP block.

Quote:

Note: The closing tag of a PHP block at the end of a file is optional, and in some cases omitting it is helpful when using include() or require(), so unwanted whitespace will not occur at the end of files, and you will still be able to add headers to the response later. It is also handy if you use output buffering, and would not like to see added unwanted whitespace at the end of the parts generated by the included files.

Source

So the answer is clear, if you are writing class or other library files it’s better not use closing PHP tag in other scrips it’s better to use ;) I had near time ago this kind of problem when we deploy project into new hosting and suddenly warning appeared in one place. Fortunately, I found out the source of problem without much efforts, but as I see know it can be easy to exclude with help preventive actions.

No Responses so far »

Comment RSS · TrackBack URI

Say your words