--- Keith Greene <[EMAIL PROTECTED]> wrote:
> It's not a bug. Anything (including spaces, newlines etc) that is not 
> inside <? and ?> is output directly to the browser.

There are two different things being discussed, and I'm not positive which
is considered a bug.

1. When a closing PHP tag, such as ?>, is followed by a newline, the
newline is not output.
2. When a script has no closing PHP tag, such as ?>, it is assumed to be
the end of the file.

Personally, I think the first makes no sense while the second makes
perfect sense. The second, to me, is no different than how many other
things are cleaned up automatically. Your database connections are closed
even when you don't explicitly close them, for example. Should PHP throw
an error when it reaches the end of the file and is still in PHP mode? Is
that really a problem?

Now, I admit that I am a big fan of symmetry, so I never omit a closing
PHP tag. However, why should it be considered an error if the end of file
is reached in PHP mode instead of output/HTML mode?

The first point above annoys me to no end. Imagine this code:

<table>
     <tr>
          <td>
               <? echo $username; ?>
          </td>
     </tr>
</table>

Now, I'm not trying to argue for one format over another, but doesn't it
seem clear that the author of this code wanted the value of $username to
be on its own row, indented by one tab within the opening and closing cell
tags? Should the newline that follows the closing PHP tag not be output? I
think that it should, but it is not.

That's my argument. :-)

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security Handbook
     Coming mid-2004
HTTP Developer's Handbook
     http://httphandbook.org/
RAMP Training Courses
     http://www.nyphp.org/ramp

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to