Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.php Subject: Re: Check for military time Date: Fri, 30 Oct 2015 20:01:07 +0100 Lines: 53 Message-ID: <5633BE73.50909@arnowelzel.de> References: <1874827.QbCUPLQBcH@PointedEars.de> <562F77B7.1050001@arnowelzel.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: individual.net 6W/r9iyr/nTo7t4sA3z3XQvuYHUxyquBQ/AlApZI1QPnBTUkRm Cancel-Lock: sha1:3N/RPJWj+cg5Eaa9JYGbBGLMVAc= In-Reply-To: Xref: csiph.com comp.lang.php:15812 Jerry Stuckle schrieb am 2015-10-27 um 14:25: > On 10/27/2015 9:10 AM, Arno Welzel wrote: >> Jerry Stuckle schrieb am 2015-10-22 um 16:23: >> >>> On 10/22/2015 9:11 AM, Thomas 'PointedEars' Lahn wrote: >> [...] >>>> Avoid ending PHP files with that; you may be accidentally outputting >>>> trailing whitespace otherwise. >>>> >>> >>> Another stoopid comment by the troll. >> >> JFTR: PHP scripts can not only output text and additional white space at >> the end may invalidate the output. Omitting the closing tag does not >> cause any harm but will avoid this for sure. >> >> > > Good programming will avoid this problem, for sure. Crappy programmers > need crappy workarounds. It's not a "crappy workaround". If PHP would *require* a closing tag at the end of a script it would cause a runtime error when omitting it. But it does not - for good reasons. Maybe you believe the official PHP documentation more than me: Cite: "If a file is pure PHP code, it is preferable to omit the PHP closing tag at the end of the file. This prevents accidental whitespace or new lines being added after the PHP closing tag, which may cause unwanted effects because PHP will start output buffering when there is no intention from the programmer to send any output at that point in the script." > Omitting a closing tag will cause harm if someone tries to add html at > the end of the page. Well - when changing a script one should do this carefully anyway and not just add HTML without looking at the code. Or do you just blindly add HTML to production code and use it without testing? -- Arno Welzel http://arnowelzel.de http://de-rec-fahrrad.de http://fahrradzukunft.de