Re: POLL: To add the final ?> or not...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2010-01-14 at 23:30 +0100, Kim Madsen wrote:

> John Corry wrote on 12/01/2010 17:04:
> > I leave ?> out.
> > 
> > I'm pretty careful about my code formatting and whitespace.
> > 
> > It's my opinion that if I can eliminate a potential problem by not including
> > an optional closing tag...there's really no reason why I shouldn't.
> 
> What is the difference between:
> 
> <?
> print "hello PHPeople";
> ?>WHITESPACE
> 
> and
> 
> <?
> print "hello PHPeople";
> WHITESPACE
> 
> Same shit when I look at it, a sloppy developer is what it is :-)
> 
> -- 
> Kind regards
> Kim Emax - masterminds.dk
> 


Plenty of differences, if you include the first one as a file, the
whitespace gets sent to the browser because it is not part of the PHP,
and so is assumed to be HTML. Once this happens, the headers have been
sent, so you can't use different headers in your script.

Thanks,
Ash
http://www.ashleysheridan.co.uk



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux