PHPackages                             laragod/dice-system - 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. laragod/dice-system

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

laragod/dice-system
===================

Deterministic-ish dice rollers for game variants (deck-based 2d6, etc.)

v1.0.2(3mo ago)03MITPHPPHP ^8.4

Since Feb 1Pushed 3mo agoCompare

[ Source](https://github.com/laragod/dicesystem)[ Packagist](https://packagist.org/packages/laragod/dice-system)[ RSS](/packages/laragod-dice-system/feed)WikiDiscussions ralph/dice-library-foundation Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

PHP Dice System
===============

[](#php-dice-system)

A comprehensive, production-ready PHP library for dice rolling with support for standard notation, custom faces, deterministic seeding, and statistical analysis.

[![PHP Version](https://camo.githubusercontent.com/4399d98dc80e8a5805229116a025620851ec56641d77cab4cf0db407da4b84b1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e342d626c75652e737667)](https://www.php.net/)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

Features
--------

[](#features)

### Core Library

[](#core-library)

- **Standard Dice Notation**: Roll dice using familiar notation like "2d6", "1d20", "3d8"
- **Deterministic Seeding**: Reproduce exact roll sequences for testing and debugging
- **Custom Dice**: Create dice with non-numeric faces (cards, attributes, etc.)
- **Dice Pools**: Manage collections of dice with aggregate operations (keep highest/lowest, reroll conditions)
- **Roll History**: Track and query previous rolls with filtering capabilities
- **Statistical Analysis**: Analyze roll distributions with mean, median, mode, standard deviation, chi-squared testing
- **Random Engines**: Choose between system randomness (cryptographically secure) or seeded Mersenne Twister

### 2d6 System (Extension)

[](#2d6-system-extension)

- Multiple 2d6 roller variants for game systems
- Deck-based rolling for card games
- Deterministic seeding for reproducible game states

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

[](#installation)

Install via Composer:

```
composer require laragod/dice-system
```

Requires **PHP 8.4** or higher.

Quick Start
-----------

[](#quick-start)

Get rolling in seconds:

```
