NYCPHP Meetup

NYPHP.org

[nycphp-talk] linebreak not emitted after ?>

Hans Zaunere lists at zaunere.com
Wed Feb 13 17:12:47 EST 2008


> This is just a curious question but consider the following trivial
> script:
> 
> #!/usr/bin/php -q
> <?php
> echo 'hello';
> ?>
> end
> 
> Why does this ouput:
> 
> $ ./test.php
> helloend
> 
> and not:
> 
> $ ./test.php
> hello
> end
> 
> Meaning the linebreak after the ?> is not emitted.
> 
> Is there some kind of special rule about this or is it just a quirk?

This is a "feature" - there's some reason they did it like this, although I
can't locate it.  If you put a space after the ?> the line break will be
preserved.

H





More information about the talk mailing list