[nycphp-talk] PHP-related book comments
Brian Pang
bpang at bpang.com
Thu Jul 15 10:48:20 EDT 2004
oh.. so that's how that happens... it annoys me, too, as I like to have
nicely formatted html (even tho it doesn't affect the output)
I guess I would trade losing that "feature" for having to make sure
there were no trailing chars that might mess up headers or using my
return;?> solution at the end of every file.
> --- Brian Pang <bpang at bpang.com> wrote:
> > If there was any "magic" feature to be added, it should be an auto
> > trim() to include[_once]|require[_once] files
> >
> > so frustrating to get that message because of a trailing \n|\r after the
> > closing ?>
>
> Actually, you have to have two newlines after a closing PHP tag to matter,
> and this annoys me (I think it annoys Hans, too, since I seem to recall a
> bug report with his name on it).
>
> Here's why it annoys me. Run this code:
>
> <table>
> <tr>
> <td>
> <? echo 'Foo'; ?>
> </td>
> </tr>
> </table>
>
> You'll get this:
>
> <table>
> <tr>
> <td>
> Foo </td>
> </tr>
> </table>
>
> Yuck. :-)
>
> The reasoning behind this, as I understand it, is simply to help avoid
> problems caused by undesired output at the end of included files. It seems
> that there is surely a way to avoid the problem without resorting to this
> "solution," but I may be missing something important.
More information about the talk
mailing list