The Random\Randomizer class

(PHP 8 >= 8.2.0)

Introduction

Provides a high-level API to the randomness provided by an Random\Engine.

Class synopsis

finalclassRandom\Randomizer {
publicreadonlyRandom\Engine$engine;
publicgetBytes(int$length): string
publicgetBytesFromString(string$string, int$length): string
publicgetFloat(float$min, float$max, Random\IntervalBoundary$boundary = Random\IntervalBoundary::ClosedOpen): float
publicgetInt(int$min, int$max): int
publicnextFloat(): float
publicnextInt(): int
publicpickArrayKeys(array$array, int$num): array
publicshuffleArray(array$array): array
publicshuffleBytes(string$bytes): string
public__unserialize(array$data): void
}

Properties

engine

The low-level source of randomness for the Random\Randomizer’s methods.

Table of Contents

To Top