What is the most common PHP coding (formatting) style? |
[eluser]t'mo[/eluser]
I'm pretty new to PHP (~6 months) but not programming (8+ years of Perl, 3+ of Java, and a handful of others). I know there's never "one true coding style" in any language, but I also know that over the span of years the community around a language will ususally come up with a general list of DO's (as well as DON'T's). So, can anybody point me in the right direction regarding "proper" PHP style? Thanks.
[eluser]Derek Allard[/eluser]
The most common is probably the PEAR coding standards. In EllisLab, we've published our own EllisLab coding standards. Both are fine examples, and I think consistency is what wins the day.
[eluser]thurting[/eluser]
PEAR. Though PHP is a crack den so you can pretty much do what you want to do.
[eluser]thomas.ernest[/eluser]
Hi there, Regarding coding standard in PHP, PHP_CodeSniffer [phpcs] is a must. However, it doesn't support Code Igniter style guide [ci-style] natively. So, I've developed something. It doesn't check all standard requirements, but already more than nothing. Feel free to give a try and share your feedbacks. [phpcs] http://pear.php.net/package/PHP_CodeSniffer/ [ci-style] http://ellislab.com/codeigniter/user-gui...guide.html [ci4php-cs] https://github.com/thomas-ernest/CodeIgn...odeSniffer
[eluser]osci[/eluser]
[quote author="thomas.ernest" date="1310474873"]Hi there, Regarding coding standard in PHP, PHP_CodeSniffer [phpcs] is a must. However, it doesn't support Code Igniter style guide [ci-style] natively. So, I've developed something. It doesn't check all standard requirements, but already more than nothing. Feel free to give a try and share your feedbacks. [phpcs] http://pear.php.net/package/PHP_CodeSniffer/ [ci-style] http://ellislab.com/codeigniter/user-gui...guide.html [ci4php-cs] https://github.com/thomas-ernest/CodeIgn...odeSniffer[/quote] Do you have to post this everywhere?
[eluser]thomas.ernest[/eluser]
Several threads were dealing with coding convention problems, I'm just trying to help all of them. I understand that I post it in many places, but those are not selected randomly and it's far from being everywhere.
|
Welcome Guest, Not a member yet? Register Sign In |