Skip to content

openssl_random_pseudo_bytes(): document the ValueError for length < 1 - #5966

Merged
lacatoire merged 1 commit into
php:masterfrom
qodelicious:openssl-random-pseudo-bytes-valueerror
Oct 19, 2026
Merged

lacatoire merged 1 commit into
php:masterfrom
qodelicious:openssl-random-pseudo-bytes-valueerror

Conversation

@qodelicious

Copy link
Copy Markdown
Contributor

The Errors section only mentioned the Exception thrown on failure. As noted in the issue, a ValueError is thrown when length is less than 1 (checked with PHP 8.4: openssl_random_pseudo_bytes(0) throws "Argument #1 ($length) must be greater than 0"). The return value part of the issue is already fixed on the current page.

Fixes #1523

@lacatoire
lacatoire merged commit 9666c3e into php:master Oct 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openssl_random_pseudo_bytes documentation update

2 participants