[TYPO3-core] CGL proposal: Dropping the closing PHP tag

Michael Stucki michael.stucki at typo3.org
Mon Oct 22 13:51:36 CEST 2012


Hi Andreas,

as far as I know, one newline is always ignored after the closing PHP
tag. So to trigger an output, you need at least two newlines:

http://php.net/manual/en/language.basic-syntax.instruction-separation.php

| The closing tag for the block will include the immediately trailing
| newline if one is present.

That means, you only run into problems if you have more than one newline
after the closing tag. Why is this a problem? I don't know of any editor
who would add more than one trailing newline to a file. Do you?

I don't really object to the change, but I would like to understand the
reason for it at least.

Let me also quote a guy who posted on stackoverflow.com:

| It's a lazy technique to increase laziness.

;-)

- michael

Am 20.10.2012 15:41, schrieb Andreas Wolf:
> Hi,
> 
> I'd like to propose a change to our CGL to get rid of the closing PHP tag.
> 
> I don't see a good reason why it is there, but it creates a lot of
> hazzle with our "no trailing newline" rule, especially when doing a
> quick fix without an IDE (I don't control these settings in every
> editor I use).
> 
> Dropping the closing tag will make sure that no content in the PHP
> file can slip into the output (which is AFAIK at least one main reason
> why we have the "no newline"-rule).
> 
> What's your opinion on that?
> 
> Regards
> Andreas
> 



More information about the TYPO3-team-core mailing list