PHPackages                             stobbsm/diceroll - 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. stobbsm/diceroll

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

stobbsm/diceroll
================

Roll arbritary size of dice

0.0.1(10y ago)010GPL-3.0PHPPHP ^7.0

Since Jul 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/stobbsm/diceroll)[ Packagist](https://packagist.org/packages/stobbsm/diceroll)[ RSS](/packages/stobbsm-diceroll/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

diceroll
========

[](#diceroll)

A PHP class to roll dice for use in dice based RPGs, or even just to roll dice.

This simple library includes an easy to extend abstract class called "Dice" that parses D&amp;D dice strings (d6+5, 1d4, 2d12, etc.) into roles for use in RPG's.

Eventually, this will be used in conjunction with other pieces of software I'm making in order to run a campaign over the internet with easy to see results.

---

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

[](#installation)

Composer - add stobbsm/diceroll to your "require" section.

Changelog
---------

[](#changelog)

- 0.0.1 - Initial release

    Initial Features:

    - 7 available basic dice sizes (d4, d6, d8, d10, d12, d20, d100)
    - Basic Dice String parsing. Example: 2d4+2 will roll 2 dice with values between 1 and 4, and then add 2 to the result, for a minimum value of 4 and a maximum value of 10.
    - Very basic commandline tool called rolldice that accepts multiple dice strings at one time, with the option of outputting in a more parsable and predictable format. (I'll be using it for shell scripting some stupid games).

    TODO:

    - Do away with strange use of classes inheriting from the base "Dice" class to control ranges. It's ugly, but I wanted to get something workable and predictable done first. To see what I mean, browse the source and check out the classes under the "Dice" directory. Very hacky.
    - Run some benchmarks and optimize what I have done so rolling dice doesn't bog down the server this is running on.

CopyRight
---------

[](#copyright)

diceroll - a PHP based RPG dice roller

Copyright (C) 2016 Matthew Stobbs

```
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see .

```

*Licensed under the GNU General Public License v3.0 ([GPLv3](LICENSE))*

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

3674d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4227473?v=4)[Matthew Stobbs](/maintainers/stobbsm)[@stobbsm](https://github.com/stobbsm)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/stobbsm-diceroll/health.svg)

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

###  Alternatives

[kelunik/certificate

Access certificate details and transform between different formats.

11348.7M14](/packages/kelunik-certificate)[kapolos/pramda

Toolkit for Practical Functional Programming in PHP

24470.1k1](/packages/kapolos-pramda)

PHPackages © 2026

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