Documentation

Random
in package

AbstractYes

Pure-PHP Random Number Generator

Tags
author

Jim Wigginton terrafrost@php.net

access

public

Table of Contents

Methods

string()  : string
Generate a random string.
safe_serialize()  : mixed
Safely serialize variables

Methods

string()

Generate a random string.

public static string(int $length) : string

Although microoptimizations are generally discouraged as they impair readability this function is ripe with microoptimizations because this function has the potential of being called a huge number of times. eg. for RSA key generation.

Parameters
$length : int
Tags
throws
RuntimeException

if a symmetric cipher is needed but not loaded

Return values
string

safe_serialize()

Safely serialize variables

private static safe_serialize(mixed &$arr) : mixed

If a class has a private __sleep() it'll emit a warning

Parameters
$arr : mixed

        
On this page

Search results