Image for post: PHP coding standards

PHP coding standards

PHP is flexible, too much flexible! It hasn't specific variables types. And you have to pay attention to handling a workflow, especially if you are working with sessions, cookies, forms, and many other features. A coding standard in PHP is necessary anyway. Here we have specific ways about how to organize your code. Let's start visiting the PHP-fig repository on GitHub

  • PSR-0, Autoloading standard (deprecated)
  • PSR-1, Basic coding standard
  • PSR-2, Coding style guide
  • PSR-3, Logger interface
  • PSR-4, Improved autoloading

And we have the PEAR coding standard too, very common and still used. Check out the Wikipedia page too: a coding standard is necessary to work better with other team members, let the code to be more clean and readable and so on. Happy coding!

Tags: