1.2.1011. Random extension

The random extension. It improves the random generators from the older PHP version, and provides a OOP interface.

<?php

$rng = $is_production
    ? new Random\Engine\Secure()
    : new Random\Engine\PCG64(1234);

$randomizer = new Random\Randomizer($rng);
$randomizer->shuffleString('foobar');

?>

See also PHP RFC: Random Extension 5.x.

1.2.1011.1. Specs

Short name

Extensions/Extrandom

Rulesets

All, Appinfo

Exakat since

2.4.7

PHP Version

With PHP 8.2 and more recent

Severity

Minor

Time To Fix

Quick (30 mins)

Precision

Very high

Available in

Entreprise Edition, Exakat Cloud