Requests for comment/Dependency injection/2014

This RFC proposes a lightweight mechanism for dependency injection. An implementation with tests and examples is provided. We could combine a facility like this with improved autoloading, and could add it to core as a first step in an iterative development process. Other options are also discussed.

Problem statement
Dependency injection is a design pattern that can facilitate unit testing, loose coupling and architecture description. Although its benefits and popularity vary from one language to another, it is a well-established pattern with a solid ecosystem of supporting libraries for PHP.