Bug->Doc #79597 [Opn->Ver]: Error in openssl-random-pseudo-bytes Example #1
| From: | cmb@php.net | Date: | Thu, 14 May 2020 17:11:13 +0000 |
| Subject: | Bug->Doc #79597 [Opn->Ver]: Error in openssl-random-pseudo-bytes Example #1 | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-17575@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79597&edit=1
ID: 79597
Updated by: cmb@php.net
Reported by: software_onbekend at hotmail dot com
Summary: Error in openssl-random-pseudo-bytes Example #1
-Status: Open
+Status: Verified
-Type: Bug
+Type: Documentation Problem
-Package: Website problem
+Package: OpenSSL related
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Indeed, the example makes no sense; if $length <= 0, the function
returns FALSE.
Previous Comments:
------------------------------------------------------------------------
[2020-05-14 17:00:24] software_onbekend at hotmail dot com
Description:
------------
---
From manual page: https://php.net/function.openssl-random-pseudo-bytes
---
The iterator in Example #1 start with the value -1
This gives an error: Fatal error: Uncaught Error: Length must be greater than 0.
Removing the minus sign solves the issue.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79597&edit=1