An PHP tool for generate random values easily.
PHP >= 8.3
via Composer:
composer require alirezasalehizadeh/random
use Alirezasalehizadeh\Random;
Random::int($min = null, $max = null)
use Random\IntervalBoundary;
use Alirezasalehizadeh\Random;
Random::float($min = null, $max = null, $boundary = IntervalBoundary::ClosedOpen)
use Alirezasalehizadeh\Random;
Random::byte($length)
use Alirezasalehizadeh\Random;
Random::string($bytes, $length = null)
use Alirezasalehizadeh\Random;
Random::array($array)
use Alirezasalehizadeh\Random;
Random::pick($array, $num = 1)
use Random\Engine\Mt19937;
use Alirezasalehizadeh\Random;
(new Random(new Mt19937))->generate()
use Alirezasalehizadeh\Random;
use Random\Engine\PcgOneseq128XslRr64;
(new Random(new PcgOneseq128XslRr64))->generate()
use Alirezasalehizadeh\Random;
use Random\Engine\Xoshiro256StarStar;
(new Random(new Xoshiro256StarStar))->generate()
Send pull request or open issue for contributing.
MIT.