Category
stdlib · php-src-strict
Problem
Calling password_needs_rehash() with fewer than two arguments must throw ArgumentCountError with php-src message text. VM throws LogicException instead, breaking catch (ArgumentCountError) branches and error-handler parity.
Valid 2/3-arg calls are unaffected; this is exception class + message only.
php-src reference
Repro (failure today — verified 2026-06-19)
<?php
$hash = password_hash('x', PASSWORD_BCRYPT);
try {
password_needs_rehash($hash);
} catch (Throwable $e) {
echo get_class($e), ': ', $e->getMessage(), "\n";
}
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php repro.php
php bin/vm.php repro.php
'
| Engine |
Exception |
Message |
| Zend PHP 8.2 |
ArgumentCountError |
password_needs_rehash() expects at least 2 arguments, 1 given |
| VM today |
LogicException ❌ |
password_needs_rehash() requires two or three arguments |
Zero-arg probe
php bin/vm.php -r 'try { password_needs_rehash(); } catch (Throwable $e) { echo get_class($e); }'
# VM: LogicException — Zend: ArgumentCountError
Scope (PHP-in-PHP)
| Path |
Work |
ext/standard/password_needs_rehash.php |
replace LogicException arity throws with ArgumentCountError matching php-src text |
lib/VM/InternalStrictArg.php or shared arity helper |
reuse across password_* family if duplicated |
ext/standard/JitPassword.php (if present) |
same exception class in JIT lowering |
No new C runtime.
Done when
Related
Category
stdlib· php-src-strictProblem
Calling
password_needs_rehash()with fewer than two arguments must throwArgumentCountErrorwith php-src message text. VM throwsLogicExceptioninstead, breakingcatch (ArgumentCountError)branches and error-handler parity.Valid 2/3-arg calls are unaffected; this is exception class + message only.
php-src reference
ext/standard/password.c—PHP_FUNCTION(password_needs_rehash)usesZEND_PARSE_PARAMETERSarity check →ArgumentCountErrorext/standard/basic_functions.stub.php—$hash,$algo,$optionsRepro (failure today — verified 2026-06-19)
ArgumentCountErrorpassword_needs_rehash() expects at least 2 arguments, 1 givenLogicException❌password_needs_rehash() requires two or three argumentsZero-arg probe
Scope (PHP-in-PHP)
ext/standard/password_needs_rehash.phpLogicExceptionarity throws withArgumentCountErrormatching php-src textlib/VM/InternalStrictArg.phpor shared arity helperext/standard/JitPassword.php(if present)No new C runtime.
Done when
ArgumentCountErrorwith php-src message on VMpassword_needs_rehash($hash, PASSWORD_BCRYPT)unchangedtest/compliance/cases/stdlib/password_needs_rehash_arity.phpt./script/ci-fast.sh --filter password_needs_rehash_aritygreenRelated