02 Sep 2008
All files in must be stored as UTF-8 character encoding. In general most files that do not contain accented characters should use the 7 bit ASCII representation, which is a valid subset of UTF-8.
There should be no whitespace before the first <?php tag. Closing ?> tags should be omitted.
Files must have lines ending in LineFeed (0x0A) characters when stored in the CVS. This is normally handled automatically by the client, but some clients (especially on Windows) do not automatically convert.
I vote for not having
I vote for not having closing ?> tags.
I worry about the UTF-8 requirement. UTF-8 is the right Multibyte format, but I'm not sure if php is ready for UTF-8 in php code until php6. If it works fine, then I'm all for it.
?> closing tags...
"should use of the closing '?>' tag be discouraged as well?"
A couple of counter-reasons:
1) In most of the existing codebase, we're including ?>. If we're going to discourage it, we'll probably have to remove these.
2) It feels dirty.
3) It bugs me to no end that the PHP folks cite the need to be more in line with valid XML as a reason for ditching the quite useful short tags, but are happy to encourage people to drop the ?>, and if they really want to solve the problem closing ?>'s + whitespace present AND get the language to grow up faster, they should probably distinguish between pure php and phtml some other way.
OK, the last one is a rant rather than a good reason. :) And I agree ?> + whitespace problems are annoying.
White Space
The White Space rule can be helpful for dealing with CSS issues in IE. IE can sometimes miss represent CSS spacing because of white space introduced in the HTML that should be ignored.
UTF-8 encoding for PHP files I am going to vote against. Zoop is written in English what will UTF-8 gain for us other then larger file sizes? If UTF-8 handling needs to be added for the util post functions that may be useful, but the code itself would gain nothing.
7-bit ASCII...
But 7-bit ASCII (aka original, vintage ASCII) is a valid subset of UTF-8... All that part is saying is "If your document uses accents, make sure it's UTF-8. Otherwise, use 7-bit ASCII".
Got I Now
I see what you are saying now. This I guess doesn't really effect the code unless there is some sort of language conversion.