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

namespace Random;
final class Randomizer {
/* Properties */
public readonly Random\Engine $engine;
/* Methods */
public function __construct(?Random\Engine $engine = null)
public function getBytes(int $length): string
public function getBytesFromString(string $string, int $length): string
public function getFloat(float $min, float $max, Random\IntervalBoundary $boundary = Random\IntervalBoundary::ClosedOpen): float
public function getInt(int $min, int $max): int
public function nextFloat(): float
public function nextInt(): int
public function pickArrayKeys(array $array, int $num): array
public function __serialize(): array
public function shuffleArray(array $array): array
public function shuffleBytes(string $bytes): string
public function __unserialize(array $data): void
}

Properties

engine

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

Table of Contents

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top