Random
Rasuvaeff\PropertyTesting\Random
Class — Package: property-testing-core — Source — Version: v0.1.0-12-g86ead85
Seedable, deterministic pseudo-random number generator.
Two instances created with the same seed produce identical sequences, which is what makes counterexamples reproducible. Backed by an object-scoped Mersenne Twister (MT19937) engine via ext-random's Random\Randomizer, so it is independent of PHP's global mt_rand state — important inside a test runner where other code may draw random numbers between runs.
Constructor
php
__construct(
int $seed,
)| Parameter | Type | Default | Description |
|---|---|---|---|
$seed | int | required |
Methods
int()
php
int(int $min, int $max): intUniform integer in the inclusive range [$min, $max].
float()
php
float(): floatUniform float in the half-open range [0.0, 1.0).
bytes()
php
bytes(int $length): stringRandom byte string of the given length (bytes in 0..255).