CodeIgniter Forums
What is the most common PHP coding (formatting) style? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: What is the most common PHP coding (formatting) style? (/showthread.php?tid=7519)



What is the most common PHP coding (formatting) style? - El Forum - 04-12-2008

[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.


What is the most common PHP coding (formatting) style? - El Forum - 04-12-2008

[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.


What is the most common PHP coding (formatting) style? - El Forum - 04-13-2008

[eluser]thurting[/eluser]
PEAR. Though PHP is a crack den so you can pretty much do what you want to do.


What is the most common PHP coding (formatting) style? - El Forum - 07-12-2011

[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-guide/general/styleguide.html
[ci4php-cs] https://github.com/thomas-ernest/CodeIgniter-for-PHP_CodeSniffer


What is the most common PHP coding (formatting) style? - El Forum - 07-12-2011

[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-guide/general/styleguide.html
[ci4php-cs] https://github.com/thomas-ernest/CodeIgniter-for-PHP_CodeSniffer[/quote]

Do you have to post this everywhere?


What is the most common PHP coding (formatting) style? - El Forum - 07-12-2011

[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.


What is the most common PHP coding (formatting) style? - El Forum - 07-12-2011

[eluser]osci[/eluser]
http://ellislab.com/forums/viewreply/913793/