#648: Revert changes from 6.0.7 (#605) because it introduced regressions.


#605 Fixes some bugs with platforms like Heroku.

In previous versions some random strings were used in the CompiledContainer which caused each regeneration/compilation of the container to have a different result, while no change in the configuration were made. The CompiledContainer has now been made idempotent: "a specific PHP-DI configuration X always results in CompiledContainer Y".


#645: Performance improvement: proxy classes are now generated when the container is compiled. That means less overhead at runtime.


#618 & #627: Support for variadics to provide multiple definition files in one method call using ContainerBuilder::addDefinitions().


#614, #622 & #621: fix regression in Container::set()


#616: Bugfix when using autowiring with wildcards (by @jasonrm)


Fix potential regression introduced in the previous release when fixing #582


  • Fix #526: Support optional parameters in factories
  • #585 Add support for PHP-Parser 4.0
  • #582 Register ContainerInterface to point to the wrapper container if it was defined


This is the complete change log. You can also read the migration guide for upgrading or the blog article to see what's new.


  • #494 The container can now be compiled for optimum performances in production
  • #294, #349, #449: DI\object() has been replaced by more specific and less ambiguous helpers:
    • DI\create() creates an object, overrides autowiring and previous definitions
    • DI\autowire() autowires an object and allows to override specific constructor and method parameters
  • The container can now be built without parameters: new Container()
  • Definitions can be nested:
    • #490 Definitions can be nested in arrays (by @yuloh)
    • #501 & #540 Autowire definitions can be nested in other definitions
    • #487 & #540 Closures are now handled as factories when they are nested in other definitions
  • #487 Closures in the config are now always interpreted as factories, even when nested inside other definitions
  • #242 Error in case a definition is not indexed by a string
  • #505 Debug container entries
  • #564 Caching was made almost entirely obsolete by the container compilation, however there is still a caching system entirely rebuilt over APCu for covering the last cases that compilation could not address (see


  • #499 & #488 Standardize resolution of nested definitions everywhere. In PHP-DI 5, definitions could be nested in some places (e.g. use a get() in an object definition, etc.). However it did not behave everywhere the same, for example it didn't work for sub-definitions in arrays. Now in PHP-DI 6 all nested definitions will all be recognized and resolved correctly everywhere. Since #494 (compiled container) performance will not be affected so we can implement a more robust behavior.
  • #343 Autowiring and Annotations do not work for object() inside arrays: it now works with the new create() and autowire() helpers

BC breaks:

  • PHP 7 or greater is required and HHVM is no longer supported
  • DI\object() has been removed, use DI\create() or DI\autowire() instead
  • #409: Scopes are removed, read more in the scopes documentation.
  • Caching was replaced by compiling the container: ContainerBuilder::setDefinitionCache() was removed, use ContainerBuilder::enableCompilation() instead.
  • #463 & #485: Container-interop support was removed, PSR-11 is used instead (by @juliangut)
  • The deprecated DI\link() helper was removed, used DI\get() instead
  • #484 The deprecated \DI\Debug class has been removed. Definitions can be cast to string directly
  • The exception DI\Definition\Exception\DefinitionException was renamed to DI\Definition\Exception\InvalidDefinition
  • The exception DI\Definition\Exception\AnnotationException was renamed to DI\Definition\Exception\InvalidAnnotation
  • #516 DI\InvokerInterface was removed in favor of Invoker\InvokerInterface

Be also aware that internal classes or interfaces may have changed.



Compatibility with PSR-11 (which required a very small BC break)



#10 Compatibility with PHPUnit 7


Stable version for PHPUnit 6.

How to install

sudo dnf upgrade --advisory=FEDORA-2019-7613467f24

This update has been submitted for testing by siwinski.

10 months ago
User Icon remi commented & provided feedback 10 months ago

This update has been pushed to testing.

10 months ago

This update has reached 7 days in testing and can be pushed to stable now if the maintainer wishes

9 months ago

This update has been submitted for stable by siwinski.

9 months ago

This update has been pushed to stable.

9 months ago

Please login to add feedback.

Content Type
Test Gating
Unstable by Karma
Stable by Karma
10 months ago
in testing
10 months ago
in stable
9 months ago
BZ#1434817 php-di-invoker-2.0.0 is available
BZ#1442587 php-di-6.0.8 is available
BZ#1512241 php-mnapoli-phpunit-easymock-1.1.0 is available

Automated Test Results