NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #449 most downloaded on Packagist
A fast and intuitive dependency injection container.
Last release 6 months ago
19 Mar 2026
Ships unpredictably
gaps range from 2 weeks to 2.3 years
Nearly every release is documented
notes for 42 of 46 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
46 releases · first in 2015
Event system for hooking into the container lifecycle
OnDefineEvent, BeforeResolveEvent, DefinitionResolvedEvent, ServiceResolvedEventforType(), forTag(), forId(), where()Container::listen() for registering filtered event listenersContainer::afterResolve() convenience method as a drop-in replacement for inflector()EventDispatcher::hasListenersFor() to check whether listeners exist for a given event typeDefinitionInterface::getTags() for retrieving tags from definitionsContainer::getDelegate(string $class) to retrieve a registered delegate container by typeDefinition::resolveClass() now throws ContainerException with actionable guidance when a class has unsatisfied constructor dependencies, instead of a raw ArgumentCountErrorContainer::inflector() - use Container::afterResolve() or the event system instead. Will be removed in v6.0.DefinitionContainerInterface no longer extends EventAwareContainerInterface (removed)'shared' tag automatically via addTag('shared')EventAwareContainerInterface - the event system is provided by EventAwareTrait on the concrete Container class, not as an interface contractOne column per quarter.
Attribute based resolution for dependencies using #[Inject] and #[Resolve] attributes.
#[Inject] and #[Resolve] attributes.
Fixed a small unreachable code bug
>=8.1Ability to overwrite a definition within the container, disabled by default
>=8.1PHP requirement now >=8.1
General language modernisation
General prep for future updates and container compilation
Assets 2 Loading
There was an error while loading. Please reload this page .
👍 1 dragomano reacted with thumbs up emoji All reactions
1 person reacted
Nothing published for this version
Now properly handle string based fully qualified class names in with preceding slashes. ( @M1ke )
Warnings for PHP 8.4 implicit nullable types ( @andypost )
Nothing published for this version
Remove an unnecessary conditional in ServiceProviderAggregate. ( @Subhansh )
Support for psr/container 1.1.0.
Fix bug that was causing an error on inflection due to introduced type hint.
Move files autoload directive to dev (@ADmad)
Way to handle non-public controllers safely (@beryllium)
New definition interface that extends psr/container
>=7.2psr/container to ^2.0.0Container::shared convenience method is now explicit Container::addShared method$shared from Container::add, use Container::addSharedServiceProviderInterface now defines return typesprovides method rather than relying on a class property.Way to handle non-public controllers safely (@beryllium)
Support for psr/container ^2.0.0 as the interface cannot be reconciled between versions
psr/container ^2.0.0 as the interface cannot be reconciled between versionsSupport for psr/container ^2.0.0
psr/container ^2.0.0Fixed an issue that caused a recursive register call. @pcoutinho
register call. @pcoutinhoFixed bug relating to ReflectionContainer::call on arrow functions.
ReflectionContainer::call on arrow functions.Experimental support for PHP 8.
Respect $new argument when getting tagged definitions.
$new argument when getting tagged definitions.{set,get}LeagueContainer methods added to ContainerAwareTrait as a temporary measure until next major release when this can be properly addressed, les
{set,get}LeagueContainer methods added to ContainerAwareTrait as a temporary measure until next major release when this can be properly addressed, less hinting of Psr\Container\ContainerInterfacesetConcrete not re-resolving class on when overriding (@jleeothon)Fixed issue that prevented service providers from registering if a previous one in the aggregate was already registered.
Fixed issue where all service providers were registered regardless of whether they need to be.
Added ability to add definition as not shared when container is set to default to shared.
{set|get}Concrete to definitions to allow for better use of extend.Re-added the share proxy method that was mistakenly removed in previous major release.
share proxy method that was mistakenly removed in previous major release.defaultToShared method.ReflectionContainer to cache resolutions and pull from cache for following calls.Allow definition aggregates to be built outside of container.
Service providers can now be pulled from the container if they are registered.
Nothing published for this version
Ensures ReflectionContainer converts class name in array callable to object.
ReflectionContainer converts class name in array callable to object.Can now wrap shared objects as RawArgument.
RawArgument.Now implementation of the PSR-11.
Service providers can now be added multiple times by giving them a signature.
Allow resolving of RawArgument objects as first class dependencies.
RawArgument objects as first class dependencies.Container::get.Bug where delegating container was not passed to delegate when needed.
Container::extend would not return a shared definition to extend.Bug introduced in 2.0.1 where shared definitions registered via a service provider would never be returned as shared.
Bug where shared definitions were not stored as shared.
Now implementation of the container-interop project.
BootableServiceProviderInterface for eagerly loaded service providers.RawArgument to ensure scalars are not resolved from the container but seen as an argument.Container::share replaces singleton functionality to improve understanding.ReflectionContainer handling all reflection based functionality.Container::call now proxies to ReflectionContainer::call and handles argument resolution in a much more efficient way.Nothing published for this version
Fixed bug where arbitrary values were attempted to be resolved as classes.
Added ServiceProvider functionality to allow cleaner resolving of complex dependencies.
ServiceProvider functionality to allow cleaner resolving of complex dependencies.Inflector functionality to allow for manipulation of resolved objects of a specific type.ContainerAwareTrait now returns self ($this).Allow arbitrary values to be registered via container config.
Improvements to Container::call functionality.
Container::call functionality.Allow singleton to be passed as method argument.
Addition of ContainerAwareTrait to provide functionality from ContainerAwareInterface.
ContainerAwareTrait to provide functionality from ContainerAwareInterface.### Added - Migrated from Orno\Di.
Your coding agent can read these notes before it upgrades. Set up the MCP server →