---
title: "php-di/php-di 7.0.0 Breaking Changes on Packagist"
description: "What each php-di/php-di release removed, renamed or changed: 145 breaking changes in 1 version on Packagist, each with its source."
canonical_url: https://since.dev/packages/packagist/php-di/php-di
last_updated: 2026-12-04
---

# 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

Latest version `7.1.1`, released August 16, 2025. MIT license. [Source repository](https://github.com/PHP-DI/PHP-DI)

Its 7.0.0 release requires [PHP 8.0](https://since.dev/calendar/php/8.0.md) or later. [PHP end of life dates](https://since.dev/calendar/php.md).

## php-di/php-di 7.0.0 breaking changes

php-di/php-di 7.0.0, released January 12, 2023: 145 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](https://github.com/PHP-DI/PHP-DI/blob/8948ffbc43f3e19c66d908593b6a94b2fc1fe6f6/doc/migration/7.0.md)
- **Removed** `@Inject`  

Injections written as @Inject phpdoc annotations are no longer supported; use the #\[Inject\] PHP attribute instead. [github.com](https://github.com/PHP-DI/PHP-DI/releases/tag/7.0.0)
- **Removed** `DI\ContainerBuilder::buildDevContainer`  

DI\\ContainerBuilder::buildDevContainer was removed in php-di/php-di 7.0.0 [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Removed** `DI\ContainerBuilder::ignorePhpDocErrors`  

DI\\ContainerBuilder::ignorePhpDocErrors was removed in php-di/php-di 7.0.0 [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Removed** `DI\ContainerBuilder::useAnnotations`  

Call useAttributes() on the container builder instead of useAnnotations() to read injections from PHP attributes. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **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](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Removed** `DI\Definition\Source\AnnotationBasedAutowiring`  

DI\\Definition\\Source\\AnnotationBasedAutowiring was removed in php-di/php-di 7.0.0 [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **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](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Renamed** `DI\Annotation\Inject`  

Use DI\\Attribute\\Inject instead. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Renamed** `DI\Annotation\Injectable`  

Use DI\\Attribute\\Injectable instead. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Renamed** `DI\Definition\Exception\InvalidAnnotation`  

Use DI\\Definition\\Exception\\InvalidAttribute instead. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Behavior changed**  

PHP-DI no longer reads types from phpdoc comments; declare types natively on properties and parameters. [github.com](https://github.com/PHP-DI/PHP-DI/blob/8948ffbc43f3e19c66d908593b6a94b2fc1fe6f6/doc/migration/7.0.md)
- **Signature changed** `DI\Annotation\Inject::__construct`  

Was public function \_\_construct(array $values); now public function \_\_construct(string|array|null $name = null). [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Annotation\Inject::getName`  

Was public function getName(); now public function getName() : string|null. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Annotation\Injectable::__construct`  

Was public function \_\_construct(array $values); now public function \_\_construct(private ?bool $lazy = null). [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Annotation\Injectable::isLazy`  

Was public function isLazy(); now public function isLazy() : bool|null. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\CompiledContainer::get`  

Was public function get($name); now public function get($id) : mixed. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\CompiledContainer::has`  

Was public function has($name); now public function has($id) : bool. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\CompiledContainer::resolveFactory`  

Was protected function resolveFactory($callable, $entryName, array $extraParameters = \[\]); now protected function resolveFactory($callable, $entryName, array $extraParameters = \[\]) : mixed. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Compiler\Compiler::__construct`  

Was public function \_\_construct(ProxyFactory $proxyFactory); now public function \_\_construct(private ProxyFactory $proxyFactory). [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Compiler\Compiler::compileValue`  

Was public function compileValue($value) : string; now public function compileValue(mixed $value) : string. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Compiler\ObjectCreationCompiler::__construct`  

Was public function \_\_construct(Compiler $compiler); now public function \_\_construct(private Compiler $compiler). [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **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](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Compiler\RequestedEntryHolder::__construct`  

Was public function \_\_construct(string $name); now public function \_\_construct(private string $name). [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **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](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Container::$delegateContainer`  

Was protected $delegateContainer; now protected ContainerInterface $delegateContainer. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Container::$entriesBeingResolved`  

Was protected $entriesBeingResolved; now protected array $entriesBeingResolved. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Container::$proxyFactory`  

Was protected $proxyFactory; now protected ProxyFactory $proxyFactory. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Container::$resolvedEntries`  

Was protected $resolvedEntries; now protected array $resolvedEntries. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Container::call`  

Was public function call($callable, array $parameters = \[\]); now public function call($callable, array $parameters = \[\]) : mixed. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Container::get`  

Was public function get($name); now public function get(string $id) : mixed. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Container::has`  

Was public function has($name); now public function has(string $id) : bool. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Container::injectOn`  

Was public function injectOn($instance); now public function injectOn(object $instance) : object. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Container::set`  

Was public function set(string $name, $value); now public function set(string $name, mixed $value) : void. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Container::setDefinition`  

Was protected function setDefinition(string $name, Definition $definition); now protected function setDefinition(string $name, Definition $definition) : void. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\ContainerBuilder::$sourceCacheNamespace`  

Was protected $sourceCacheNamespace; now protected string $sourceCacheNamespace. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\ContainerBuilder::addDefinitions`  

Was public function addDefinitions(...$definitions) : self; now public function addDefinitions(string|array|DefinitionSource ...$definitions) : self. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\decorate`  

Was function decorate($callable) : FactoryDefinitionHelper; now function decorate(callable|array|string $callable) : FactoryDefinitionHelper. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Definition\ArrayDefinition::__construct`  

Was public function \_\_construct(array $values); now public function \_\_construct(private array $values). [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Definition\ArrayDefinition::__toString`  

Was public function \_\_toString(); now public function \_\_toString() : string. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Definition\ArrayDefinition::replaceNestedDefinitions`  

Was public function replaceNestedDefinitions(callable $replacer); now public function replaceNestedDefinitions(callable $replacer) : void. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Definition\ArrayDefinition::setName`  

Was public function setName(string $name); now public function setName(string $name) : void. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Definition\DecoratorDefinition::getDecoratedDefinition`  

Was public function getDecoratedDefinition(); now public function getDecoratedDefinition() : ?Definition. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **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](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Definition\EnvironmentVariableDefinition::__toString`  

Was public function \_\_toString(); now public function \_\_toString() : string. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Definition\EnvironmentVariableDefinition::getDefaultValue`  

Was public function getDefaultValue(); now public function getDefaultValue() : mixed. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Definition\EnvironmentVariableDefinition::replaceNestedDefinitions`  

Was public function replaceNestedDefinitions(callable $replacer); now public function replaceNestedDefinitions(callable $replacer) : void. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Definition\EnvironmentVariableDefinition::setName`  

Was public function setName(string $name); now public function setName(string $name) : void. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **Signature changed** `DI\Definition\ExtendsPreviousDefinition::setExtendedDefinition`  

Was public function setExtendedDefinition(Definition $definition); now public function setExtendedDefinition(Definition $definition) : void. [packagist.org](https://packagist.org/packages/php-di/php-di#7.0.0)
- **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](https://packagist.org/packages/php-di/php-di#7.0.0)

And 95 more in this version. [Sign up to see every change](https://app.since.dev/login?mode=signup&src=package-page)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#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.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
