Return Values

Errors/Exceptions

If the strong parameter is TRUE, then an
E_WARNING level error will be emitted when the
fallback rand() implementation is used to fill
the remaining random bytes (e.g., when not enough random data was found,
initially).

Examples

Example #1 OAuthProvider::generateToken() example

<?php$p = new OAuthProvider();

$t = $p->generateToken(4);

echo strlen($t), PHP_EOL;echo bin2hex($t), PHP_EOL;

?>

The above example will output
something similar to:

4
b6a82c27

Notes

Note:

When not enough random data is available to the system, this function will
fill the remaining random bytes using the internal PHP rand()
implementation.