PHP 8.4.0 RC4 available for testing

The Random\Randomizer class

(PHP 8 >= 8.2.0)

简介

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

类摘要

final class Random\Randomizer {
/* 属性 */
public readonly Random\Engine $engine;
/* 方法 */
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
}

属性

engine

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

目录

添加备注

用户贡献的备注

此页面尚无用户贡献的备注。
To Top