Skip to content

Fix password_needs_rehash() ArgumentCountError for missing args (#9263) - #15095

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-9263-password-needs-rehash-argcount
Jul 2, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-9263-password-needs-rehash-argcount

Conversation

@PurHur

@PurHur PurHur commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • password_needs_rehash() with too few or too many arguments now throws ArgumentCountError matching Zend/php-src instead of LogicException.
  • VM and JIT call() entry guards share the same messages.

php-src reference

  • ext/standard/password.cPHP_FUNCTION(password_needs_rehash) via zend_parse_parameters

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php -r "try { password_needs_rehash(\"x\"); } catch (Throwable \$e) { echo get_class(\$e), \": \", \$e->getMessage(), PHP_EOL; }"
php bin/vm.php -r "try { password_needs_rehash(\"x\"); } catch (Throwable \$e) { echo get_class(\$e), \": \", \$e->getMessage(), PHP_EOL; }"
vendor/bin/phpunit --filter password_needs_rehash_argcount
'

Output (both runtimes):

ArgumentCountError: password_needs_rehash() expects at least 2 arguments, 1 given

PHPUnit: OK (2 tests, 2 assertions)

Closes #9263

Made with Cursor

…9263)

Zend throws ArgumentCountError when too few or too many arguments are passed;
the VM used LogicException. Align VM and JIT entry guards with php-src.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Stdlib: password_needs_rehash() missing args throws LogicException not ArgumentCountError (ext/standard/password.c)

1 participant