This list really needs a reply-to header, I'd replied that I saw the light a few emails ago, but realized that it just went to one person. Sigh.
On 8/12/07, Ryan Brooks <[EMAIL PROTECTED]> wrote: > > > This is actually a pretty common question. > > Taken straight from the Zend Coding Standards (draft) seen at: > http://framework.zend.com/wiki/display/ZFDEV/PHP+Coding+Standard+(draft) > > "For files that contain only PHP code, the closing tag ("?>") is to be > omitted. It is not required by PHP, and omitting it prevents trailing > whitespace from being accidentally injected into the output." > > Generally, as such, it's a good idea to omit the closing tag in PHP files > containing only PHP code (such as class files). For things like views, which > are mixes of PHP and HTML, close all PHP. > > This will prevent you from encountering trailing whitespace, which can be > a bit of a headache. > > > On Sat, 11 Aug 2007 20:58:18 -0700, Stanislav Malyshev <[EMAIL PROTECTED]> > wrote: > >> After going through the docs I realized that the examples with no end > ?> > >> was not a typo. Is that for every php script that uses in the framework > > or > >> just the framework classes? Will something bad happen if you do use > '?>' > >> ? How did that design decision come about? > > > > Nothing bad happens if you use "?>". However, if you use "?>" and after > > it put some whitespace, something bad does happen - this whitespace gets > > output, and it might be output in wrong place at the wrong time. Since > > closing ?> is not required and anyway nothing is going to happen after > > ?>, many people omit it. > > -- > > Stanislav Malyshev, Zend Software Architect > > [EMAIL PROTECTED] http://www.zend.com/ > > (408)253-8829 MSN: [EMAIL PROTECTED] > > -- Ghetto Java: http://www.streetprogrammer.com