Reply To: How Symfony/Laravel automatically autoload and instantiate required object?


Last year I wrote a tutorial on how to write your own toy DI container, which you may find useful. It’s at

The end result isn’t something I’d be comfortable using in production, but it demonstrates how a DI container works in principle. Basically it just uses the Reflection API to resolve items, resolving any dependencies recursively.