Re: PHP tags - any reasons to close ?>

From: Date: Tue, 23 Sep 2008 12:53:28 +0000
Subject: Re: PHP tags - any reasons to close ?>
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-280762@lists.php.net to get a copy of this message
> I have seen some projects where people start with opening tag <?php but they
> DON'T close it with ?>
> This is especially the case of CONFIG.php files...
>
> 1) What's the reason of that?

One reason is if it's a library file for example, trailing white space
would be considered as output, which typically you wouldn't want (eg
you can't send headers after the output has started). If you don't use
the closing PHP tag, you would avoid this.

> 2) What if you would not close any 100% PHP files?

Nada.

> 3) What's the reason of making an empty space after ?>
> I've also seen this in some projects.

Don't know. Doesn't seem wise to me.

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.phpguru.org/RGraph


Thread (14 messages)

« previous php.general (#280762) next »