google-code-export / gwtphp-derpc

Automatically exported from code.google.com/p/gwtphp-derpc
1 stars 0 forks source link

PHP closing tags not generated #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What do you see instead: Opening tag <?php is there, closing tag ?> is missing 
in all generated PHP files.

Please provide any additional information below: r6.

Original issue reported on code.google.com by lightwor...@gmail.com on 2 Jun 2011 at 7:34

GoogleCodeExporter commented 9 years ago
I have not add the closing tag in all php file i wrote.
I m not sure it would be mandatory. PHP does not raise any message or error for 
that.

I have searched a bit, and i found in Zend documentation : 
"For files that contain only PHP code, the closing tag ("?>") is never 
permitted. It is not required by PHP, and omitting it´ prevents the accidental 
injection of trailing white space into the response."

So I think i will not add closing tag to php files for now.

Original comment by mathieu....@gmail.com on 3 Jun 2011 at 1:51

GoogleCodeExporter commented 9 years ago
The link of the php file formatting :

http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html

Original comment by mathieu....@gmail.com on 3 Jun 2011 at 1:53

GoogleCodeExporter commented 9 years ago
After some more reading, indeed PHP doc says it is optional to have an closing 
tag at the end of a PHP file: 
http://php.net/manual/en/language.basic-syntax.instruction-separation.php 
...still it does not feel intuitive :-)

Original comment by lightwor...@gmail.com on 3 Jun 2011 at 8:07

GoogleCodeExporter commented 9 years ago
I understand, but it is safer for unwanted chars :)

Original comment by mathieu....@gmail.com on 4 Jun 2011 at 11:29