PHP Standard Recommendation

The PHP Standard Recommendation (PSR) is a PHP specification published by the PHP Framework Interop Group. Similar to Java Specification Request for Java, it serves the standardization of programming concepts in PHP. The aim is to enable interoperability of components and to provide a common technical basis for implementation of proven concepts for optimal programming and testing practices. The PHP-FIG is formed by several PHP frameworks founders.{{cite web |url=http://www.php-fig.org/personnel/ |title=PHP-FIG members list |publisher=PHP-FIG official website. hej |access-date=10 January 2016}}

Each PSR is suggested by members and voted according to an established protocol to act consistently and in line with their agreed upon processes.{{cite web |url=https://www.php-fig.org/bylaws/voting-protocol/ |title=Voting Protocol |publisher=PHP Framework Interop Group |access-date=10 January 2016}}

class="wikitable"

!Number

NameDescriptionEditorCoordinatorSponsorStatus
PSR-0Autoloading StandardIt describes the mandatory requirements that must be adhered to for autoloader interoperability.{{cite web |url=http://www.php-fig.org/psr/psr-0/ |title=PSR-0: Autoloading Standard |publisher=PHP-FIG official website. |access-date=10 January 2016}}{{N/a|N/A}}{{N/a|N/A}}{{N/a|N/A}}Deprecated and substituted by PSR-4{{cite web |url=http://www.php-fig.org/psr/ |title=PSR status list |publisher=PHP-FIG official website. |access-date=10 January 2016}}
PSR-1Basic Coding StandardIt comprises what should be considered the standard coding elements that are required to ensure a high level of technical interoperability between shared PHP code.{{cite web |url=http://www.php-fig.org/psr/psr-1/ |title=PSR-1: Basic Coding Standard |publisher=PHP-FIG official website. |access-date=10 January 2016}}{{N/a|N/A}}{{N/a|N/A}}{{N/a|N/A}}Accepted
PSR-2Coding Style GuideIt considers PSR-1 and it is intended to reduce cognitive friction when scanning code from different authors. It does so by enumerating a shared set of rules and expectations about how to format PHP code.{{cite web |url=http://www.php-fig.org/psr/psr-2/ |title=PSR-2: Coding Style Guide |publisher=PHP-FIG official website. |access-date=10 January 2016}}{{N/a|N/A}}{{N/a|N/A}}{{N/a|N/A}}Deprecated {{Cite web|url=https://www.php-fig.org/psr/#deprecated|title=PHP Standards Recommendations - PHP-FIG|website=www.php-fig.org|language=en|access-date=2020-02-14}}{{Cite web|title=PHP Standards Recommendations - PHP-FIG|url=https://www.php-fig.org/psr/#numerical-index|website=www.php-fig.org|language=en|access-date=2020-05-09}}
PSR-3Logger InterfaceIt describes a common interface for logging libraries.{{cite web |url=http://www.php-fig.org/psr/psr-3/ |title=PSR-3: Logger Interface |publisher=PHP-FIG official website. |access-date=10 January 2016}}Jordi Boggiano{{N/a|N/A}}{{N/a|N/A}}Accepted
PSR-4Autoloading StandardIt describes a specification for autoloading classes from file paths. It is fully interoperable, and can be used in addition to any other autoloading specification, including PSR-0. This PSR also describes where to place files that will be auto loaded according to the specification.{{cite web |url=http://www.php-fig.org/psr/psr-4/ |title=PSR-4: Autoloading Standard |publisher=PHP-FIG official website. |access-date=10 January 2016}}Paul M. JonesPhil SturgeonLarry GarfieldAccepted
PSR-5PHPDoc StandardThe main purpose of this PSR is to provide a complete and formal definition of the PHPDoc standard. This PSR deviates from its predecessor, the de facto PHPDoc Standard associated with phpDocumentor 1.x, to provide support for newer features in the PHP language and to address some of the shortcomings of its predecessor.{{cite web |url=https://github.com/phpDocumentor/fig-standards/tree/master/proposed |title=PSR-5: PHPDoc Standard |publisher=PHP Documentor official git repository at Github. |access-date=10 January 2016}}Mike van RielPhil SturgeonDonald GilbertDraft
PSR-6Caching InterfaceThe goal of this PSR is to allow developers to create cache-aware libraries that can be integrated into existing frameworks and systems without the need for custom development.{{cite web |url=http://www.php-fig.org/psr/psr-6/ |title=PSR-6: Caching Interface |publisher=PHP-FIG official website. |access-date=10 January 2016}}Larry GarfieldPaul DragoonisRobert HafnerAccepted
PSR-7HTTP Message InterfaceIt describes common interfaces for representing HTTP messages as described in RFC 7230 and RFC 7231, and URIs for use with HTTP messages as described in RFC 3986.{{cite web |url=http://www.php-fig.org/psr/psr-7/ |title=PSR-7: HTTP Message Interface |publisher=PHP-FIG official website. |access-date=10 January 2016}}Matthew Weier O'PhinneyBeau SimensenPaul M. JonesAccepted
PSR-8Huggable InterfaceIt establishes a common way for objects to express mutual appreciation and support by hugging. This allows objects to support each other in a constructive fashion, furthering cooperation between different PHP projects.{{cite web |url=https://github.com/php-fig/fig-standards/blob/master/proposed/psr-8-hug/psr-8-hug.md |title=PSR-8: Huggable Interface |publisher=PHP-FIG official git repository at Github. |access-date=10 January 2016}}Larry GarfieldCal EvansPaul M. JonesAbandoned
PSR-9Security DisclosureIt gives project leads a clearly defined approach to enabling end users to discover security disclosures using a clearly defined structured format for these disclosures.{{cite web |url=https://github.com/php-fig/fig-standards/blob/master/proposed/security-disclosure-publication.md |title=PSR-9: Security Disclosure |publisher=PHP-FIG official git repository at Github. |access-date=10 January 2016}}Lukas Kahwe SmithKorvin SzantoLarry GarfieldAbandoned
PSR-10Security AdvisoriesIt gives researchers, project leads, upstream project leads and end users a defined and structured process for disclosing security vulnerabilities.{{cite web |url=https://github.com/php-fig/fig-standards/blob/master/proposed/security-reporting-process.md |title=PSR-10: Security Advisories |publisher=PHP-FIG official git repository at Github. |access-date=10 January 2016}}Lukas Kahwe SmithLarry GarfieldKorvin SzantoAbandoned
PSR-11Container InterfaceIt describes a common interface for dependency injection containers. The goal is to standardize how frameworks and libraries make use of a container to obtain objects and parameters (called entries in the rest of this document).{{cite web |url=https://github.com/container-interop/fig-standards/blob/master/proposed/container.md |title=PSR-11: Container Interface |publisher=PHP-FIG PSR-11 official git repository at Github. |access-date=10 January 2016}}Matthieu Napoli, David NégrierPaul M. JonesJeremy LindblomAccepted
PSR-12

|Extended Coding Style Guide

|It extends, expands and replaces PSR-2, the coding style guide and requires adherence to PSR-1, the basic coding standard.{{Cite web|url=https://www.php-fig.org/psr/psr-12/|title=PSR-12: Extended Coding Style Guide - PHP-FIG|website=www.php-fig.org|access-date=2020-06-04}}

|Michael Cullum

|Korvin Szanto

|Alexander Makarov

|Accepted

PSR-13

|Hypermedia Links

|It describes common interfaces for representing a hypermedia link.{{Cite web|url=https://www.php-fig.org/psr/psr-13/|title=PSR-13: Link definition interfaces - PHP-FIG|website=www.php-fig.org|access-date=2019-02-04}}

|Larry Garfield

|Matthew Weier O’Phinney

|Marc Alexander

|Accepted

PSR-14

|Event Manager

|It describes common interfaces for dispatching and handling events.{{cite web |url=https://github.com/php-fig/fig-standards/blob/master/proposed/event-dispatcher.md |title=PSR-14: Event Dispatcher |publisher=PHP-FIG official git repository at Github. |access-date=4 February 2019}}

|Larry Garfield

|

|

|Accepted

PSR-15

|HTTP Server Request Handlers

|It describes common interfaces for HTTP server request handlers and HTTP server middleware components that use HTTP messages.{{Cite web|url=https://www.php-fig.org/psr/psr-15/|title=PSR-15: HTTP Server Request Handlers - PHP-FIG|website=www.php-fig.org|access-date=2019-02-04}}

|Woody Gilk

|

|Matthew Weier O’Phinney

|Accepted

PSR-16

|Simple Cache

|It describes a simple yet extensible interface for a cache item and a cache driver.{{Cite web|url=https://www.php-fig.org/psr/psr-16/|title=PSR-16: Common Interface for Caching Libraries - PHP-FIG|website=www.php-fig.org|access-date=2019-02-04}}

|Paul Dragoonis

|Jordi Boggiano

|Fabien Potencier

|Accepted

PSR-17

|HTTP Factories

|It describes a common standard for factories that create PSR-7 compliant HTTP objects.{{Cite web|url=https://www.php-fig.org/psr/psr-17/|title=PSR-17: HTTP Factories - PHP-FIG|website=www.php-fig.org|access-date=2019-02-04}}

|Woody Gilk

|

|Matthew Weier O’Phinney

|Accepted

PSR-18

|HTTP Client

|It describes a common interface for sending HTTP requests and receiving HTTP responses.{{Cite web|url=https://www.php-fig.org/psr/psr-18/|title=PSR-18: HTTP Client - PHP-FIG|website=www.php-fig.org|access-date=2019-02-04}}

|Tobias Nyholm

|

|Sara Golemon

|Accepted

PSR-19

|PHPDoc tags

|It provides a complete catalog of tags in the PHPDoc standard.{{cite web |url=https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md |title=PSR-19: PHPDoc tags |publisher=PHP-FIG official git repository at Github. |access-date=4 February 2019}}

|Chuck Burgess

|

|

|Draft

PSR-20

|Clock

|It provides a standard way of accessing the clock - allowing interopability during testing, when testing behavior that has timing based side effects.{{Cite web|url=https://www.php-fig.org/psr/psr-20/|title=PSR-20: Clock - PHP-FIG|website=www.php-fig.org|access-date=2024-01-14}}

|Chris Seufert

|

|Chuck Burgess

|Accepted

PSR-21

|Internationalization

|TBD.{{cite web |url=https://github.com/php-fig/fig-standards/blob/master/proposed/internationalization.md |title=PSR-21: Internationalization |publisher=PHP-FIG official git repository at Github. |access-date=14 January 2024}}

|Navarr Barnier

|

|

|Draft

PSR-22

|Application Tracing

|TBD.{{cite web |url=https://github.com/php-fig/fig-standards/blob/master/proposed/tracing.md |title=PSR-22: Application Tracing |publisher=PHP-FIG official git repository at Github. |access-date=14 January 2024}}

|Adam Allport

|

|

|Draft

The PHP-FIG official website has the PSR documentation that follows the RFC 2119 written by Scott Bradner in March 1997 at Harvard University.

References

{{reflist}}