PHPackages                             moddengine/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. [Framework](/categories/framework)
4. /
5. moddengine/dice

ActiveLibrary[Framework](/categories/framework)

moddengine/dice
===============

A minimalist Dependency injection container (DIC) for PHP 7.1+ and PHP 8.0+.

v4.1.6(3y ago)711.4k↓33.3%5BSD-2-ClausePHPPHP &gt;=7.1.0CI failing

Since May 6Pushed 3y agoCompare

[ Source](https://github.com/moddengine/Dice)[ Packagist](https://packagist.org/packages/moddengine/dice)[ Docs](https://github.com/moddengine/Dice)[ RSS](/packages/moddengine-dice/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (7)Dependencies (2)Versions (29)Used By (5)

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

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

[![Build Status](https://camo.githubusercontent.com/385deae1b9c41ce4759a0b60c649ea5b397e99ce7e32d54c9ade52aa273f48c5/68747470733a2f2f7472617669732d63692e636f6d2f6d6f6464656e67696e652f446963652e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/moddengine/Dice)

*Please note: This version is a fork that provides a few fixes that have not yet been merged into the Original Repo mantained by Tom Butler.*

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 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:

```
