[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[phpGroupWare-developers] Closing PHP tag
From: |
Dave Hall |
Subject: |
[phpGroupWare-developers] Closing PHP tag |
Date: |
Sun, 11 May 2008 14:53:55 +1000 |
Hi all,
I have updated the coding standard to include a new requirement to not
include a closing PHP tag (?>) in script files.
The main reasons for this are:
1 It isn't needed, ?> is only needed when switching out of PHP mode
2 It can introduce whitespace which will introduce output, which may not
be desired
3 Many other projects are taking this approach
Projects which have dropped the closing ?>
* Zend Framework -
http://framework.zend.com/manual/en/coding-standard.php-file-formatting.html#coding-standard.php-file-formatting.general
* Drupal - http://drupal.org/coding-standards
* dokuwiki - http://wiki.splitbrain.org/wiki:development#php_closing_tags
* Joomla - http://docs.joomla.org/Coding_style_and_standards#PHP_Code_Tags
* postNuke - http://community.postnuke.com/Wiki-CodingStandards.htm
Those which are silent or against it
* PEAR (silent) - http://pear.php.net/manual/en/standards.tags.php
* MediaWiki (silent) - http://www.mediawiki.org/wiki/Manual:Coding_conventions
* phpBB (silent) - http://area51.phpbb.com/docs/coding-guidelines.html
* Gallery2 - http://codex.gallery2.org/Gallery2:Coding_Standards#PHP_Code_Tags
* WordPress - http://codex.wordpress.org/WordPress_Coding_Standards
The PHP manual even recommends dropping them, see
http://php.net/basic-syntax.instruction-separation
I am sure google could have turned up more for either side, but these
were the first 10 FOSS PHP projects that sprang to mind.
As a side note, it looks like most projects are using the PEAR
convention these days. I personally like the ZF standard, but that is
what I am used to.
I have been dropping them when I am working on a file for some time. If
there is serious objections I will roll back the changes to the
standard.
</another_religious_debate>
Cheers
Dave
--
LLLLL
L*LLL
LLLLL
LLLLL DAVE
LLLLL HALL
CONSULTING
Open Source
Business Solutions
p +61 410 47 42 55
e address@hidden
w davehall.com.au
f +61 3 8610 0029
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [phpGroupWare-developers] Closing PHP tag,
Dave Hall <=