PHPackages                             danielsonsilva/diceroller - 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. danielsonsilva/diceroller

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

danielsonsilva/diceroller
=========================

Package to work with customized dice rolling and getting the results from them

v1.4.1(4y ago)1161MITPHPPHP &lt;=7.3.27CI failing

Since Apr 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/DanielsonSilva/diceroller)[ Packagist](https://packagist.org/packages/danielsonsilva/diceroller)[ RSS](/packages/danielsonsilva-diceroller/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (7)Used By (1)

Dice Roller Package
===================

[](#dice-roller-package)

Were you searching for an easy way to roll that dice with PHP? Well, you've found the right package for you. You'll have the object representation to add rolls and modify them. Create, add rolls and roll to know the results.

[Live Demo](http://danielsonsilva.tech/diceroller/)

It is as simples as this:

```
use danielsonsilva\DiceRoller\DiceRoller;

// Create your object
$diceRoller = new DiceRoller();

// Add dice into the roller
$dice->addDice(3, 4); // adds 3 d4 dice
$dice->addDice(1, 20); // adds 1 d20 die

// Apply modifier if you wish
$dice->addValue(5); // adds a +5 into the roll

// Or you can subtract from that added modifier
$dice->subtractValue(7); // the roll modifier becomes -2

// Then roll to know the results
$rollResult = $dice->roll();

// Get the string result, in this case could be
// 3d4 (2 + 1 + 4) + 1d20 (18)
$stringResult = $dice->getResultString();

```

Now you can use as a package and do some dice rolling.

Version History
===============

[](#version-history)

v 1.4.1
-------

[](#v-141)

- Tests were made in php 7.3.27

v 1.4.0
-------

[](#v-140)

- After the roll, a result string showing each result from each group dice
- Unit tests added to check the new features

v 1.4.0
-------

[](#v-140-1)

- After the roll, a result string showing each result from each group dice
- Unit tests added to check the new features

v 1.3.0
-------

[](#v-130)

- Downgraded the minimum version of PHP required to use this package from 7.4 to 7.3

v 1.2.0
-------

[](#v-120)

- Features added: isEmpty and set and get modifier to change the modifier completely;
- Unit tests added to check the new features.

v 1.1.0
-------

[](#v-110)

- Features added: string representation of the DiceRoller (\_\_toString())
- Unit tests improved to check the minimum and maximum values from a roll

v 1.0.0
-------

[](#v-100)

- Package danielsonsilva/diceroller created;
- Features: roll, addDice, addValue and subtractValue;
- Unit tests to check its effectiveness

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~107 days

Recently: every ~131 days

Total

6

Last Release

1672d ago

PHP version history (3 changes)v1.3.0PHP 7.3.17

v1.4.0PHP &lt;=7.3.17

v1.4.1PHP &lt;=7.3.27

### Community

Maintainers

![](https://www.gravatar.com/avatar/23971f67bcf6b36a419c009430b83ce1003acfb65de46ba4d5d1092f6e861b56?d=identicon)[DanielsonSilva](/maintainers/DanielsonSilva)

---

Top Contributors

[![danfxs](https://avatars.githubusercontent.com/u/144858834?v=4)](https://github.com/danfxs "danfxs (12 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/danielsonsilva-diceroller/health.svg)

```
[![Health](https://phpackages.com/badges/danielsonsilva-diceroller/health.svg)](https://phpackages.com/packages/danielsonsilva-diceroller)
```

###  Alternatives

[wesselperik/nova-status-field

A Laravel Nova field for displaying statuses.

30213.5k](/packages/wesselperik-nova-status-field)[karnbrockgmbh/yii2-modal-ajax

A wrapper around Yii2 Bootstrap Modal for using an ActiveForm via AJAX inside

135.9k](/packages/karnbrockgmbh-yii2-modal-ajax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
