PHPackages                             nbish11/dice - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nbish11/dice

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nbish11/dice
============

A minimalist Dependency injection container (DIC) for PHP. Please note: 3.0+ is only compatible with PHP 7.0. The 2.0 branch is compatbile with PHP 5.6.

0155PHP

Since Jan 10Pushed 2y agoCompare

[ Source](https://github.com/nbish11/Dice)[ Packagist](https://packagist.org/packages/nbish11/dice)[ RSS](/packages/nbish11-dice/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

[Dice PHP Dependency Injection Container](https://r.je/dice.html)
=================================================================

[](#dice-php-dependency-injection-container)

Dice is a minimalist Dependency Injection Container for PHP with a focus on being lightweight and fast as well as requiring as little configuration as possible.

Project Goals
-------------

[](#project-goals)

1. To be lightweight and not a huge library with dozens of files (Dice is a single 100 line class) yet support all features (and more) offered by much more complex containers
2. To "just work". Basic functionality should work with zero configuration
3. Where configuration is required, it should be as minimal and reusable as possible as well as easy to use.
4. Speed! (See [the section on performance](#performance))

Installation
------------

[](#installation)

Just include the lightweight `Dice.php` in your project and it's usable without any further configuration:

Simple example:

```
