MersenneTwister

Custom random algorithm to get consistent behaviour between PHP versions.

Copied from: http://www.dr-chuck.com/csev-blog/2015/09/a-mersenne_twister-implementation-in-php/

Methods

init

init(int $seed) : void
static

Arguments

$seed

int

getInstance

getInstance() : \ls\mersenne\MersenneTwister
static

Shuffle with seed

shuffle(array $arr) : array

Arguments

$arr

array

Response

array

__construct

__construct(integer $seed = null) 

Arguments

$seed

integer

setSeed

setSeed($seed) 

Arguments

$seed

generateTwister

generateTwister() 

getNext

getNext(integer $min = null, integer $max = null) 

Arguments

$min

integer

$max

integer

Properties

state

state : 

index

index : 

Singleton variable

instance : \ls\mersenne\MersenneTwister
static