The right way logo

The right way

Free

Reference for PHP best practices and coding standards

FreeFree tier
Type
Open Source

About The right way

PHP: The Right Way is an easy-to-read, quick reference for PHP popular coding standards, links to authoritative tutorials, and best practices. It aims to correct outdated information and bad practices by providing up-to-date guidance for PHP developers of all skill levels. The site covers topics such as getting started with the latest PHP versions, built-in web server, macOS setup via Homebrew or Macports, and includes translations in many languages. It is a living document maintained by the community on GitHub, and is also available as a downloadable book in PDF, EPUB, and MOBI formats.

Key Features

Easy-to-read quick reference
Covers popular coding standards
Links to authoritative tutorials
Translated into many languages
Available as downloadable book (PDF, EPUB, MOBI)
Community-driven and open source
Covers latest PHP versions (8.x)
Guidance on built-in web server and macOS setup
Comparison of different approaches and use-cases

Pros & Cons

Pros
  • Concise and well-organized reference
  • Focus on current best practices
  • Multi-language support
  • Open source and community-maintained
  • Available in multiple formats (web, PDF, EPUB, MOBI)
  • Practical guidance on avoiding common pitfalls
Cons
  • Not a comprehensive PHP tutorial; assumes some PHP knowledge
  • Opinionated; reflects contributors' views on best practices
  • May require regular updates to stay current with PHP releases

Best For

New PHP developers learning best practicesExperienced PHP developers seeking up-to-date referencesDevelopers migrating from older PHP versions to 8.xTeams establishing coding standardsLearning PHP environment setup on macOS

FAQ

Which PHP version should I use?
Use the current stable release (PHP 8.5) as it adds many new features and optimizations over older versions. Older versions like 7.4 are already end of life.
How can I start learning PHP without a full web server?
PHP 5.4 and newer include a built-in web server. You can start it from your terminal with the command: php -S localhost:8000