21Dec/102
PHP Closing tag ?>
Sometime ago I saw some framework where all files missed PHP closing tags, I wondered why ? Simply, this tag is not required by PHP parser, interesting when this was introduced. But one advantage of this is elimination of hunting down final carriage return character in the end file. This additional CR mess up the output when including.
In projects with 200+ code files, one simple return at the end of file can cause bugs hard to find.
UPD: My discovery is clearly described in documentation
http://php.net/manual/en/language.basic-syntax.instruction-separation.php
Did you find this post useful? Support the the author ($10)
My Google Profile+
English
Русский
December 22nd, 2010 - 08:21
It is explained clearly the optional nature of the file ending ?> in the php manual
http://php.net/manual/en/language.basic-syntax.instruction-separation.php
December 22nd, 2010 - 08:47
Cool ) Completely missed this point and documentation gives exactly same hint as I did. Interesting was it in PHP with every beginning ? like version 3 or 4.