1--TEST--
2Random: Randomizer: getInt(): Returned values with insufficient bits are correctly expanded (64 Bit)
3--SKIPIF--
4<?php if (PHP_INT_SIZE != 8) die("skip 64-bit only"); ?>
5--FILE--
6<?php
7
8use Random\Engine;
9use Random\Randomizer;
10
11final class ByteEngine implements Engine
12{
13    public $count = 0;
14
15    public function generate(): string
16    {
17        return "\x01\x02\x03\x04\x05\x06\x07\x08"[$this->count++];
18    }
19}
20
21$randomizer = new Randomizer(new ByteEngine());
22
23var_dump(bin2hex(pack('P', $randomizer->getInt(0, 0x00FF_FFFF_FFFF_FFFF))));
24
25?>
26--EXPECT--
27string(16) "0102030405060700"
28