php-di/php-di breaking changes
php-di/php-di 7.0.0 (January 12, 2023) is its newest release with breaking changes, 145 of them. The first: php-di/php-di 7.0.0 requires PHP 8.0 or later. Every breaking API change we have recorded in php-di/php-di on Packagist: 145 breaking changes in 1 version. Below, its one version with breaking changes, newest first, removals and renames first, each with its source.
Updated December 4, 2026
On this page
Latest version 7.1.1, released August 16, 2025. MIT license. Source repository
Its 7.0.0 release requires PHP 8.0 or later. PHP end of life dates.
php-di/php-di 7.0.0 breaking changes
- Removed
PHP-DI 7 requires PHP 8.0 or greater, so code running on older PHP must stay on PHP-DI 6. github.com - Removed
@Inject
Injections written as @Inject phpdoc annotations are no longer supported; use the #[Inject] PHP attribute instead. github.com - Removed
DI\ContainerBuilder::buildDevContainer
DI\ContainerBuilder::buildDevContainer was removed in php-di/php-di 7.0.0 packagist.org - Removed
DI\ContainerBuilder::ignorePhpDocErrors
DI\ContainerBuilder::ignorePhpDocErrors was removed in php-di/php-di 7.0.0 packagist.org - Removed
DI\ContainerBuilder::useAnnotations
Call useAttributes() on the container builder instead of useAnnotations() to read injections from PHP attributes. packagist.org - Removed
DI\Definition\Helper\CreateDefinitionHelper::DEFINITION_CLASS
DI\Definition\Helper\CreateDefinitionHelper::DEFINITION_CLASS was removed in php-di/php-di 7.0.0 packagist.org - Removed
DI\Definition\Source\AnnotationBasedAutowiring
DI\Definition\Source\AnnotationBasedAutowiring was removed in php-di/php-di 7.0.0 packagist.org - Removed
DI\Definition\Source\DefinitionArray::WILDCARD_PATTERN
DI\Definition\Source\DefinitionArray::WILDCARD_PATTERN was removed in php-di/php-di 7.0.0 packagist.org - Renamed
DI\Annotation\Inject
Use DI\Attribute\Inject instead. packagist.org - Renamed
DI\Annotation\Injectable
Use DI\Attribute\Injectable instead. packagist.org - Renamed
DI\Definition\Exception\InvalidAnnotation
Use DI\Definition\Exception\InvalidAttribute instead. packagist.org - Behavior changed
PHP-DI no longer reads types from phpdoc comments; declare types natively on properties and parameters. github.com - Signature changed
DI\Annotation\Inject::__construct
Was public function __construct(array $values); now public function __construct(string|array|null $name = null). packagist.org - Signature changed
DI\Annotation\Inject::getName
Was public function getName(); now public function getName() : string|null. packagist.org - Signature changed
DI\Annotation\Injectable::__construct
Was public function __construct(array $values); now public function __construct(private ?bool $lazy = null). packagist.org - Signature changed
DI\Annotation\Injectable::isLazy
Was public function isLazy(); now public function isLazy() : bool|null. packagist.org - Signature changed
DI\CompiledContainer::get
Was public function get($name); now public function get($id) : mixed. packagist.org - Signature changed
DI\CompiledContainer::has
Was public function has($name); now public function has($id) : bool. packagist.org - Signature changed
DI\CompiledContainer::resolveFactory
Was protected function resolveFactory($callable, $entryName, array $extraParameters = []); now protected function resolveFactory($callable, $entryName, array $extraParameters = []) : mixed. packagist.org - Signature changed
DI\Compiler\Compiler::__construct
Was public function __construct(ProxyFactory $proxyFactory); now public function __construct(private ProxyFactory $proxyFactory). packagist.org - Signature changed
DI\Compiler\Compiler::compileValue
Was public function compileValue($value) : string; now public function compileValue(mixed $value) : string. packagist.org - Signature changed
DI\Compiler\ObjectCreationCompiler::__construct
Was public function __construct(Compiler $compiler); now public function __construct(private Compiler $compiler). packagist.org - Signature changed
DI\Compiler\ObjectCreationCompiler::resolveParameters
Was public function resolveParameters(MethodInjection $definition = null, ReflectionMethod $method = null) : array; now public function resolveParameters(?MethodInjection $definition, ?ReflectionMethod $method) : array. packagist.org - Signature changed
DI\Compiler\RequestedEntryHolder::__construct
Was public function __construct(string $name); now public function __construct(private string $name). packagist.org - Signature changed
DI\Container::__construct
Was public function __construct(MutableDefinitionSource $definitionSource = null, ProxyFactory $proxyFactory = null, ContainerInterface $wrapperContainer = null); now public function __construct(array|MutableDefinitionSource $definitions =... packagist.org - Signature changed
DI\Container::$delegateContainer
Was protected $delegateContainer; now protected ContainerInterface $delegateContainer. packagist.org - Signature changed
DI\Container::$entriesBeingResolved
Was protected $entriesBeingResolved; now protected array $entriesBeingResolved. packagist.org - Signature changed
DI\Container::$proxyFactory
Was protected $proxyFactory; now protected ProxyFactory $proxyFactory. packagist.org - Signature changed
DI\Container::$resolvedEntries
Was protected $resolvedEntries; now protected array $resolvedEntries. packagist.org - Signature changed
DI\Container::call
Was public function call($callable, array $parameters = []); now public function call($callable, array $parameters = []) : mixed. packagist.org - Signature changed
DI\Container::get
Was public function get($name); now public function get(string $id) : mixed. packagist.org - Signature changed
DI\Container::has
Was public function has($name); now public function has(string $id) : bool. packagist.org - Signature changed
DI\Container::injectOn
Was public function injectOn($instance); now public function injectOn(object $instance) : object. packagist.org - Signature changed
DI\Container::set
Was public function set(string $name, $value); now public function set(string $name, mixed $value) : void. packagist.org - Signature changed
DI\Container::setDefinition
Was protected function setDefinition(string $name, Definition $definition); now protected function setDefinition(string $name, Definition $definition) : void. packagist.org - Signature changed
DI\ContainerBuilder::$sourceCacheNamespace
Was protected $sourceCacheNamespace; now protected string $sourceCacheNamespace. packagist.org - Signature changed
DI\ContainerBuilder::addDefinitions
Was public function addDefinitions(...$definitions) : self; now public function addDefinitions(string|array|DefinitionSource ...$definitions) : self. packagist.org - Signature changed
DI\decorate
Was function decorate($callable) : FactoryDefinitionHelper; now function decorate(callable|array|string $callable) : FactoryDefinitionHelper. packagist.org - Signature changed
DI\Definition\ArrayDefinition::__construct
Was public function __construct(array $values); now public function __construct(private array $values). packagist.org - Signature changed
DI\Definition\ArrayDefinition::__toString
Was public function __toString(); now public function __toString() : string. packagist.org - Signature changed
DI\Definition\ArrayDefinition::replaceNestedDefinitions
Was public function replaceNestedDefinitions(callable $replacer); now public function replaceNestedDefinitions(callable $replacer) : void. packagist.org - Signature changed
DI\Definition\ArrayDefinition::setName
Was public function setName(string $name); now public function setName(string $name) : void. packagist.org - Signature changed
DI\Definition\DecoratorDefinition::getDecoratedDefinition
Was public function getDecoratedDefinition(); now public function getDecoratedDefinition() : ?Definition. packagist.org - Signature changed
DI\Definition\EnvironmentVariableDefinition::__construct
Was public function __construct(string $variableName, bool $isOptional = false, $defaultValue = null); now public function __construct(private string $variableName, private bool $isOptional = false, private mixed $defaultValue = null). packagist.org - Signature changed
DI\Definition\EnvironmentVariableDefinition::__toString
Was public function __toString(); now public function __toString() : string. packagist.org - Signature changed
DI\Definition\EnvironmentVariableDefinition::getDefaultValue
Was public function getDefaultValue(); now public function getDefaultValue() : mixed. packagist.org - Signature changed
DI\Definition\EnvironmentVariableDefinition::replaceNestedDefinitions
Was public function replaceNestedDefinitions(callable $replacer); now public function replaceNestedDefinitions(callable $replacer) : void. packagist.org - Signature changed
DI\Definition\EnvironmentVariableDefinition::setName
Was public function setName(string $name); now public function setName(string $name) : void. packagist.org - Signature changed
DI\Definition\ExtendsPreviousDefinition::setExtendedDefinition
Was public function setExtendedDefinition(Definition $definition); now public function setExtendedDefinition(Definition $definition) : void. packagist.org - Signature changed
DI\Definition\FactoryDefinition::__construct
Was public function __construct(string $name, $factory, array $parameters = []); now public function __construct(string $name, callable|array|string $factory, array $parameters = []). packagist.org
And 95 more in this version. Sign up to see every change
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.