NYCPHP Meetup

NYPHP.org

[nycphp-talk] linebreak not emitted after ?>

John Campbell jcampbell1 at gmail.com
Wed Feb 13 17:51:43 EST 2008


On Feb 13, 2008 5:17 PM, Allen Shaw <ashaw at polymerdb.org> wrote:
> Michael B Allen wrote:
> > the linebreak after the ?> is not emitted.
> >
> > Is there some kind of special rule about this or is it just a quirk?
> >
> Part of PHP syntax.
> <http://www.php.net/manual/en/language.basic-syntax.php> says:
> "when PHP hits the ?> closing tags, it simply starts outputting whatever
> it finds (except for an immediately following newline - see instruction
> separation) until it hits another opening tag"
>
> Not that I can tell you /why/ they do it this way.
>

This "feature" was implemented to avoid "output already started" error
messages caused by text editors that auto-append a newline at the end
of the file.

John C.



More information about the talk mailing list