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. [1]
Each PSR is suggested by members and voted according to an established protocol to act consistently and in line with their agreed upon processes. [2]
Number | Name | Description | Editor | Coordinator | Sponsor | Status |
---|---|---|---|---|---|---|
PSR-0 | Autoloading Standard | It describes the mandatory requirements that must be adhered to for autoloader interoperability. [3] | N/A | N/A | N/A | Deprecated and substituted by PSR-4 [4] |
PSR-1 | Basic Coding Standard | It comprises what should be considered the standard coding elements that are required to ensure a high level of technical interoperability between shared PHP code. [5] | N/A | N/A | N/A | Accepted [4] |
PSR-2 | Coding Style Guide | It 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. [6] | N/A | N/A | N/A | Deprecated [7] [4] [8] |
PSR-3 | Logger Interface | It describes a common interface for logging libraries. [9] | Jordi Boggiano | N/A | N/A | Accepted [4] |
PSR-4 | Autoloading Standard | It 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. [10] | Paul M. Jones | Phil Sturgeon | Larry Garfield | Accepted [4] |
PSR-5 | PHPDoc Standard | The 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. [11] | Mike van Riel | Phil Sturgeon | Donald Gilbert | Draft [4] |
PSR-6 | Caching Interface | The 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. [12] | Larry Garfield | Paul Dragoonis | Robert Hafner | Accepted [4] |
PSR-7 | HTTP Message Interface | It 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. [13] | Matthew Weier O'Phinney | Beau Simensen | Paul M. Jones | Accepted [4] |
PSR-8 | Huggable Interface | It 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. [14] | Larry Garfield | Cal Evans | Paul M. Jones | Abandoned [4] |
PSR-9 | Security Disclosure | It gives project leads a clearly defined approach to enabling end users to discover security disclosures using a clearly defined structured format for these disclosures. [15] | Lukas Kahwe Smith | Korvin Szanto | Larry Garfield | Abandoned [4] |
PSR-10 | Security Advisories | It gives researchers, project leads, upstream project leads and end users a defined and structured process for disclosing security vulnerabilities. [16] | Lukas Kahwe Smith | Larry Garfield | Korvin Szanto | Abandoned [4] |
PSR-11 | Container Interface | It 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). [17] | Matthieu Napoli, David Négrier | Paul M. Jones | Jeremy Lindblom | Accepted [4] |
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. [18] | Michael Cullum | Korvin Szanto | Alexander Makarov | Accepted [4] |
PSR-13 | Hypermedia Links | It describes common interfaces for representing a hypermedia link. [19] | Larry Garfield | Matthew Weier O’Phinney | Marc Alexander | Accepted [4] |
PSR-14 | Event Manager | It describes common interfaces for dispatching and handling events. [20] | Larry Garfield | Accepted [4] | ||
PSR-15 | HTTP Server Request Handlers | It describes common interfaces for HTTP server request handlers and HTTP server middleware components that use HTTP messages. [21] | Woody Gilk | Matthew Weier O’Phinney | Accepted [4] | |
PSR-16 | Simple Cache | It describes a simple yet extensible interface for a cache item and a cache driver. [22] | Paul Dragoonis | Jordi Boggiano | Fabien Potencier | Accepted [4] |
PSR-17 | HTTP Factories | It describes a common standard for factories that create PSR-7 compliant HTTP objects. [23] | Woody Gilk | Matthew Weier O’Phinney | Accepted [4] | |
PSR-18 | HTTP Client | It describes a common interface for sending HTTP requests and receiving HTTP responses. [24] | Tobias Nyholm | Sara Golemon | Accepted [4] | |
PSR-19 | PHPDoc tags | It provides a complete catalog of tags in the PHPDoc standard. [25] | Chuck Burgess | Draft [4] | ||
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. [26] | Chris Seufert | Chuck Burgess | Accepted [4] | |
PSR-21 | Internationalization | TBD. [27] | Navarr Barnier | Draft [4] | ||
PSR-22 | Application Tracing | TBD. [28] | Adam Allport | Draft [4] |
The PHP-FIG official website has the PSR documentation that follows the RFC 2119 written by Scott Bradner in March 1997 at Harvard University.
IronPython is an implementation of the Python programming language targeting the .NET and Mono frameworks. The project is currently maintained by a group of volunteers at GitHub. It is free and open-source software, and can be implemented with Python Tools for Visual Studio, which is a free and open-source extension for Microsoft's Visual Studio IDE.
Git is a distributed version control system that tracks versions of files. It is often used to control source code by programmers who are developing software collaboratively.
PHPDoc is an adaptation of Javadoc format for the PHP programming language. It is still an informal standard for commenting PHP code, but it is in the process of being formalized. It allows external document generators like phpDocumentor, which is the de facto standard implementation, to generate documentation of APIs and helps some IDEs such as Zend Studio, NetBeans, JetBrains PhpStorm, ActiveState Komodo Edit and IDE, PHPEdit and Aptana Studio to interpret variable types and other ambiguities in the loosely typed language and to provide improved code completion, type hinting and debugging.
Munin is a free and open-source computer system monitoring, network monitoring, and infrastructure monitoring software application.
Laminas Project is an open source, object-oriented web application framework implemented in PHP 7 and licensed under the New BSD License. The framework is basically a collection of professional PHP-based packages. The framework uses various packages by the use of Composer as part of its package dependency managers; some of them are PHPUnit for testing all packages, Travis CI for continuous Integration Services. Laminas provides to users a support of the model–view–controller (MVC) in combination with Front Controller solution. MVC implementation in Laminas has five main areas. The router and dispatcher functions to decide which controller to run based on data from URL, and controller functions in combination with the model and view to develop and create the final web page.
This is a comparison of notable web frameworks, software used to build and deploy web applications.
Pimcore is an open-source enterprise PHP software platform for product information management (PIM), master data management (MDM), customer data management (CDP), digital asset management (DAM), content management (CMS), and digital commerce.
SWORD is an interoperability standard that allows digital repositories to accept the deposit of content from multiple sources in different formats via a standardized protocol. In the same way that the HTTP protocol allows any web browser to talk to any web server, so SWORD allows clients to talk to repository servers. SWORD is a profile (specialism) of the Atom Publishing Protocol, but restricts itself solely to the scope of depositing resources into scholarly systems.
FuelPHP is an open-source web application framework written in PHP which implements the HMVC pattern.
Composer is an application-level dependency manager for the PHP programming language that provides a standard format for managing dependencies of PHP software and required libraries. It was developed by Nils Adermann and Jordi Boggiano, who continue to manage the project. They began development in April 2011 and first released it on March 1, 2012. Composer is strongly inspired by Node.js's "npm" and Ruby's "bundler". The project's dependency solving algorithm started out as a PHP-based port of openSUSE's libzypp SAT solver.
Express.js, or simply Express, is a back end web application framework for building RESTful APIs with Node.js, released as free and open-source software under the MIT License. It is designed for building web applications and APIs. It has been called the de facto standard server framework for Node.js.
ImpressPages is an open-source PHP framework with built-in content editor. Features include MVC engine, inline editing and drag&drop interface. It is distributed under the GNU GPL v.3.0 and MIT licences.
Phalcon is a PHP web framework based on the model–view–controller (MVC) pattern. Originally released in 2012, it is an open-source framework licensed under the terms of the BSD License.
WebXR Device API is a Web application programming interface (API) that describes support for accessing augmented reality and virtual reality devices, such as the HTC Vive, Oculus Rift, Oculus Quest, Google Cardboard, HoloLens, Apple Vision Pro, Magic Leap or Open Source Virtual Reality (OSVR), in a web browser. The WebXR Device API and related APIs are standards defined by W3C groups, the Immersive Web Community Group and Immersive Web Working Group. While the Community Group works on the proposals in the incubation period, the Working Group defines the final web specifications to be implemented by the browsers.
The Pop PHP Framework a free and open source PHP Web framework that was created by Nick Sagona. It is distributed under the BSD License and hosted on GitHub. The framework is intended to be utilized for rapid application development, with an emphasis on web applications.
Deno is a runtime for JavaScript, TypeScript, and WebAssembly that is based on the V8 JavaScript engine and the Rust programming language. Deno was co-created by Ryan Dahl, who also created Node.js.
PeachPie is an open-source PHP language compiler and runtime for the .NET Framework and .NET. It is built on top of the Microsoft Roslyn compiler platform and is based on the first-generation Phalanger project. PeachPie compiles source code written in PHP to CIL byte-code. PeachPie takes advantage of the JIT compiler component of the .NET Framework in order to handle the beginning of the compilation process. Its purpose is not to generate or optimize native code, but rather to compile PHP scripts into .NET assemblies containing CIL code and meta-data. In July 2017, the project became a member of the .NET Foundation.