random_bytes()
function random_bytes(int $length): string
Generates cryptographically secure pseudo-random bytes.
Parameters:
$length(int)
Returns: string
Availability
| Compiled (AOT) | Magician (eval) |
|---|---|
| Available | Not available yet |
- Compiled code accepts any argument count and raises PHP’s
ArgumentCountErrorat run time, so the signature shown is the PHP-visible one.
No examples yet. Check examples/ and showcases/ for usage patterns.
Internals
For how random_bytes is implemented in the compiler, see the internals page.