Skip to content

Randomizer::getInt(0, 2**32 - 1) with Mt19937 always returns 1 #9415

Closed
@TimWolla

Description

@TimWolla

Description

The following code:

<?php

$r = new Random\Randomizer(new Random\Engine\Mt19937());
var_dump($r->getInt(0, 2**32 - 1));

Resulted in this output:

int(1)

But I expected this output instead:

Not always 1.

PHP Version

Current git master

Operating System

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions