PSR-11 Container is a PHP interface specification that defines the contract for dependency injection containers.
The project addresses the fragmentation problem of incompatible container implementations across the PHP ecosystem by providing a standardized set of interfaces. Rather than implementing a container itself, it establishes abstract contracts that any container implementation can follow. This allows libraries and applications to depend on the interface rather than a specific container implementation, enabling interoperability between different dependency injection solutions.
Developers should adopt this when building libraries or frameworks that need to work with multiple container implementations without tight coupling to any single one. Projects that want to accept a container as a dependency should type-hint against these interfaces rather than concrete implementations. This is particularly valuable for middleware, plugins, and reusable packages that may be used in applications with different container choices. The project is not itself a container implementation; developers still need to choose and install a concrete implementation that adheres to these interfaces.
The project maintains a stable, minimal interface specification with no active development activity beyond maintenance of the core abstractions. Changes are infrequent and focused on preserving backward compatibility with existing implementations.