Re: headers and newline at end of script
| From: | Jochem Maas | Date: | Thu, 20 Jul 2006 15:22:28 +0000 |
| Subject: | Re: headers and newline at end of script | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-239631@lists.php.net to get a copy of this message | ||
Martin Marques wrote:
> I'm looking for an opinion on programming style.
>
> Basicaly, I make systems using PEAR::DB and PEAR::HTML_Template_IT. This
> last one puts all the HTML away from the PHP code, which has made life
> much easier.
>
> Now, sometimes I warning messages like this one:
>
> PHP Warning: Cannot modify header information - headers already sent in
>
> I know what it means, so I just look for newlines at the end of my PHP
> scripts, especially after the closing ?> and delete them.
>
> Now, my question is: Is it a bad practice to "NOT" close the script with
> the PHP closing "?>"? I mean, just leave the script without a closing
> PHP simbols, as this scripts are included?
I never add the final closing '?>' in any script for this very reason.
whether it's bad practice or I don't know (can't be any worse than the
flamewar on internals@lists.php.net though ;-)
>
> --
> 21:50:04 up 2 days, 9:07, 0 users, load average: 0.92, 0.37, 0.18
> ---------------------------------------------------------
> Lic. Martín Marqués | SELECT 'mmarques' ||
> Centro de Telemática | '@' || 'unl.edu.ar';
> Universidad Nacional | DBA, Programador,
> del Litoral | Administrador
> ---------------------------------------------------------
>