Best practices
Habits experienced PHP teams agree on.
declare(strict_types=1) in every file
Type errors surface instead of being coerced.
Follow PSR standards
PSR-4 autoloading, PSR-12 / PER coding style, PSR-7/15 HTTP messages and middleware.
Static analysis in CI
PHPStan or Psalm at a high level catch bugs that tests miss.
Prepared statements only
Use PDO or your ORM's parameter binding for every query.
Enable OPcache in production
Caches compiled bytecode so scripts are not re-parsed on every request.
Saved in this browser only. Part of Clean code foundations (0/5).