PHP notes¶
This one is a bit old, but lots of good stuff that goes beyond style. Some things are questionable. I prefer Getters/Setters over Attributes as Objects (at least how the example shows it) to allow for better error handling. I prefer no underscores in naming except for constants that use all caps...but that is only a style issue.
From the Zend framework folks:
http://framework.zend.com/manual/en/coding-standard.html
An intro:
http://godbit.com/article/introduction-to-php-coding-standards
Nice Presentation:
http://weierophinney.net/matthew/uploads/php_development_best_practices.pdf
PHP Unit testing
http://www.phpunit.de/pocket_guide/
For automatically checking code against the Pear standards use CodeSniffer:
http://pear.php.net/package/PHP_CodeSniffer/
Best Practices:
http://www.odi.ch/prog/design/php/guide.php
Updated by Amber Herold over 13 years ago · 1 revisions