Why are php tags not closed in files?

e.g. in

drupal6-2\index.php
drupal6-2\themes\garland\template.php

php tags are opened at top of file but not closed

A quote from this blog

http://choosetheforce.blogspot.com/2008/05/should-you-close-that-php-tag...

"This is a Bad Idea. It is far from something I would defend to the death, but-- left to my own devices-- I will always close all opened tags. I recognize that PHP allows you to omit the closing tag, and the Zend coding standard goes so far as to actually forbid closing this tag for PHP-only files".

Edited by: VeryMisunderstood; moved to General Discussion Forum from Theme Development Forum

Comments

vm’s picture

No need to post multiple threads to ask the same question.

This is a duplicate of http://drupal.org/node/263859, where I've already answered.

_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )

michaelfavia’s picture

php automatically closes the tag at EOF (end of file) as demonstrated here:

http://us.php.net/basic-syntax.instruction-separation

Because these are not mixed use (php and html) pages the open tag ha s a benefit (no white screens of death and associated errors about output before starting sessions) with no drawback except having to answer this question alot. :). Hope that explains it well. -mf