What are PSR standards (e.g., PSR-4, PSR-12), and why are they critical for the PHP ecosystem?
Last updated
PSR standards are PHP-FIG recommendations:
PSR-4underpins Composer autoloading andPSR-12defines a common code style.Interface PSRs (
PSR-3logger,PSR-7HTTP,PSR-11container) define swappable contracts, so code works with any compliant implementation.Composer and frameworks like Laravel and Symfony assume them, so packages plug in easily and vendor lock-in is reduced.
- https://www.php-fig.org/psr/
- https://jonesrussell.github.io/blog/psr-standards-in-php-practical-guide-for-developers/
- https://www.youtube.com/watch?v=rqzYdHdyMH0
- https://www.specbee.com/blogs/introduction-php-standard-recommendation-psr
- https://www.php-fig.org/psr/psr-12/
- https://www.php-fig.org/psr/psr-12/meta/
- https://medium.com/@rupeshm173/understanding-php-coding-standards-a-guide-to-psr-12-7ae3cb4e8c5c
- https://hyring.com/jobseeker-toolkit/interview-questions/technical/php