Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Matthew Carter Newsgroups: comp.lang.php Subject: Re: Check for military time Date: Tue, 27 Oct 2015 23:03:43 -0400 Organization: Ahungry (http://ahungry.com) Lines: 39 Message-ID: <8737wvd78w.fsf@ahungry.com> References: <1874827.QbCUPLQBcH@PointedEars.de> <562F77B7.1050001@arnowelzel.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="7c986cd4736462de309a749b207746fe"; logging-data="7170"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18qpCixAKHN0P1eylnNVIw1" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:TT3lCtbAHFR0ArZC5W3C5fEVD1Q= sha1:BwVjQ2XLOQ2N9z8ARbcdE5oGh04= Xref: csiph.com comp.lang.php:15801 Jerry Stuckle writes: > On 10/27/2015 10:19 AM, J�rn Andersen wrote: >> On Tue, 27 Oct 2015 09:25:31 -0400, Jerry Stuckle >> wrote: >> >>> On 10/27/2015 9:10 AM, Arno Welzel wrote: >> >>>> 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. >> >> php.net recommends not using the PHP closing tag “if a file is pure >> PHP code”. >> http://php.net/manual/en/language.basic-syntax.phptags.php >> >>> Omitting a closing tag will cause harm if someone tries to add html at >>> the end of the page. >> >> > > First of all, that is a big "if". Second, this is an opinion of one (or > a small group of) programmers which violates good coding practices which > have worked for decades. But then I have never been that impressed with > the programmers there. PSR recommends that definitions (classes/functions) and code producing side effects be in separate files anyways, so I see no issue with omitting a closing tag in definition files (as no HTML should be randomly added to the end anyways) and detecting that your HTML is failing to render due to being within an unclosed PHP tag is easier to debug than a closed tag with whitespace hidden afterwards. -- Matthew Carter (m@ahungry.com) http://ahungry.com