Skip to content

ext/sodium: Fix parameter name in the length-mismatch errors - #23396

Merged
TimWolla merged 2 commits into
php:masterfrom
lacatoire:fix/sodium-add-param-name
Aug 23, 2026
Merged

ext/sodium: Fix parameter name in the length-mismatch errors#23396
TimWolla merged 2 commits into
php:masterfrom
lacatoire:fix/sodium-add-param-name

Conversation

@lacatoire

Copy link
Copy Markdown
Member

The length-mismatch errors of sodium_add(), sodium_memcmp() and sodium_compare() refer to $string_2, which does not exist. All three functions declare $string2.

The Argument #1 ($string1) part is generated from the arginfo and was already correct; only the hardcoded cross-reference to the second argument was stale.

The added test triggers the mismatch on all three functions and lists sodium_add()'s parameter names through Reflection, so a later rename that forgets these messages fails the test.

sodium_add(), sodium_memcmp() and sodium_compare() all cross-reference
their second argument as $string_2, a name none of them declares; the
stub calls it $string2.
Comment thread ext/sodium/tests/sodium_length_mismatch_error.phpt Outdated
Co-authored-by: NickSdot <32384907+NickSdot@users.noreply.github.com>
@TimWolla
TimWolla merged commit 0e8d462 into php:master Aug 23, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants