[doc-en] master: Define the key in the sodium_crypto_stream_xchacha20_xor_ic() example (#6119)
| From: | Tim Bond via GitHub | Date: | Sat, 21 Nov 2026 09:25:59 +0000 |
| Subject: | [doc-en] master: Define the key in the sodium_crypto_stream_xchacha20_xor_ic() example (#6119) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-23987@lists.php.net to get a copy of this message | ||
Author: Tim Bond (cookieguru)
Committer: GitHub (web-flow)
Pusher: lacatoire
Date: 2026-11-21T10:25:56+01:00
Commit: https://github.com/php/doc-en/commit/278d9d8c5a64f9cd01893c89543d8f1f68c99ed2
Raw diff: https://github.com/php/doc-en/commit/278d9d8c5a64f9cd01893c89543d8f1f68c99ed2.diff
Define the key in the sodium_crypto_stream_xchacha20_xor_ic() example (#6119)
The example passed $key to sodium_crypto_stream_xchacha20_xor() and
sodium_crypto_stream_xchacha20_xor_ic() without ever defining it. On
PHP 8 that raises an undefined variable warning and a deprecation for
passing null, and the call then fails because null is not a valid
key. Generate the key with sodium_crypto_stream_xchacha20_keygen(),
after which the example prints the documented output.
Changed paths:
M reference/sodium/functions/sodium-crypto-stream-xchacha20-xor-ic.xml
Diff: