Dutch PHP Conference 2026 - Call For Papers

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

final class Random\Randomizer {
/* Properties */
public readonly Random\Engine $engine ;
/* Methods */
public __construct (? Random\Engine $engine = null )
public getBytes (int $length): string
public getBytesFromString (string $string, int $length): string
public getFloat (float $min, float $max, Random\IntervalBoundary $boundary = Random\IntervalBoundary::ClosedOpen): float
public getInt (int $min, int $max): int
public nextFloat (): float
public nextInt (): int
public pickArrayKeys (array $array, int $num): array
public __serialize (): array
public shuffleArray (array $array): array
public shuffleBytes (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

Found A Problem?

Learn How To Improve This PageSubmit a Pull RequestReport a Bug
+add a note

User Contributed Notes

There are no user contributed notes for this page.

AltStyle によって変換されたページ (->オリジナル) /