PHPackages                             cheich/rng - 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. cheich/rng

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

cheich/rng
==========

Random number generator

06PHP

Since Oct 2Pushed 8y ago1 watchersCompare

[ Source](https://github.com/cheich/RNG)[ Packagist](https://packagist.org/packages/cheich/rng)[ RSS](/packages/cheich-rng/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Random number generator
=======================

[](#random-number-generator)

Features
--------

[](#features)

- Pick random items from lists
- Set probability for each item or via a lucky list
- Calculate probabilities

Example
-------

[](#example)

```
try {
  $random = new Coincidence($items, true);

  // Get probabilities as array
  $random->probabilities();

  // Set some lucky items with a multiplier of 2
  $random->luckylist($luckylist, 2);

  // Get new probabilities as array
  $random->probabilities();

  // Pick an item randomly
  $random->pick();

  // Pick an item randomly and remove it from the list
  $random->pick(true);

  // Restore items and probabilities
  $random->restore();

  // Random number
  $random->number();
} catch (CoincidenceException $e) {
  echo 'Something went wrong...';
}
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6bb6d20ba0d8577499139756ca1f044548d31d703313b05b2d05ea1764757cde?d=identicon)[cheich](/maintainers/cheich)

---

Top Contributors

[![cheich](https://avatars.githubusercontent.com/u/5952533?v=4)](https://github.com/cheich "cheich (7 commits)")

---

Tags

coincidenceprobabilityrandom

### Embed Badge

![Health badge](/badges/cheich-rng/health.svg)

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

###  Alternatives

[adbario/php-dot-notation

PHP dot notation access to arrays

4638.8M182](/packages/adbario-php-dot-notation)[digital-creative/custom-relationship-field

Emulate HasMany relationship without having a real relationship set between resources

33200.0k](/packages/digital-creative-custom-relationship-field)[yethee/enum-bundle

This bundle provides a typed enumeration for Symfony applications

3188.4k](/packages/yethee-enum-bundle)

PHPackages © 2026

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