Doc #79597 [Ver->Csd]: Error in openssl-random-pseudo-bytes Example #1

From: Date: Sun, 17 May 2020 11:02:12 +0000
Subject: Doc #79597 [Ver->Csd]: Error in openssl-random-pseudo-bytes Example #1
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17587@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: phpdocbot@php.net Reported by: software_onbekend at hotmail dot com Summary: Error in openssl-random-pseudo-bytes Example #1 -Status: Verified +Status: Closed Type: Documentation Problem Package: OpenSSL related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmb Revision: http://git.php.net/?p=doc/en.git;a=commit;h=78aa9e47fa0d18686db103a4362f41855b3b0511 Log: Fix #79597: Error in openssl-random-pseudo-bytes Example #1 Previous Comments: ------------------------------------------------------------------------ [2020-05-14 17:11:13] cmb@php.net Indeed, the example makes no sense; if $length <= 0, the function returns FALSE. ------------------------------------------------------------------------ [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

« previous php.doc.bugs (#17587) next »