container-interop 0 Packagist

Containers interoperability

3 years after MIT

Container Interoperability

Latest Stable Version Total Downloads

container-interop tries to identify and standardize features in container objects (service locators, dependency injection containers, etc.) to achieve interoperability.

Through discussions and trials, we try to create a standard, made of common interfaces but also recommendations.

If PHP projects that provide container implementations begin to adopt these common standards, then PHP applications and projects that use containers can depend on the common interfaces instead of specific implementations. This facilitates a high-level of interoperability and flexibility that allows users to consume any container implementation that can be adapted to these interfaces.

The work done in this project is not officially endorsed by the PHP-FIG, but it is being worked on by members of PHP-FIG and other good developers. We adhere to the spirit and ideals of PHP-FIG, and hope this project will pave the way for one or more future PSRs.


You can install this package through Composer:

composer require container-interop/container-interop

The packages adheres to the SemVer specification, and there will be full backward compatibility between minor versions.




View open request for comments

Compatible projects

Projects implementing ContainerInterface

Projects implementing the delegate lookup feature

Middlewares implementing ContainerInterface

Projects using ContainerInterface

The list below contains only a sample of all the projects consuming ContainerInterface. For a more complete list have a look here.

blast-facades: Minimize complexity and represent dependencies as facades.
interop.silex.di: an extension to Silex that adds support for any container-interop compatible container
mindplay/walkway: a modular request router
mindplay/middleman: minimalist PSR-7 middleware dispatcher
PHP-DI/Invoker: extensible and configurable invoker/dispatcher
Silly: CLI micro-framework
Slim v3
Woohoo Labs. Harmony: a flexible micro-framework


Everyone is welcome to join and contribute.

The general workflow looks like this:

  1. Someone opens a discussion (GitHub issue) to suggest an interface
  2. Feedback is gathered
  3. The interface is added to a development branch
  4. We release alpha versions so that the interface can be experimented with
  5. Discussions and edits ensue until the interface is deemed stable by a general consensus
  6. A new minor version of the package is released

We try to not break BC by creating new interfaces instead of editing existing ones.

While we currently work on interfaces, we are open to anything that might help towards interoperability, may that be code, best practices, etc.

Related Repositories



A simple and flexible PHP middleware dispatcher based on PSR-7 and Container-Int ...



Doctrine factories for container-interop ...



The simplest [in]dependency injection container for PHP7, compatible with contai ...



[EXPERIMENTAL] Promoting container interoperability through standard definitions ...



Lazy loading for interop container ...

Top Contributors

mnapoli moufmouf Ocramius jeremeamia shochdoerfer mindplay-dk pyrsmk BafS codeeverything Sam-Burns njasm cxj aurimasniekis AndrewCarterUK inxilpro ecoreng harikt JackPrice kocsismate Maks3w mbunge elazar chrismichaels84 codeliner TomasVotruba snapshotpl idealogica


package version
psr/container ^1.0


-   1.1.0 zip tar
-   1.0.0 zip tar