Skip to content

Regression: hash_hmac_algos Reflection missing array return — Zend array (ext/hash/hash.stub.php) #27942

Description

@PurHur

Category

bug · php-src-strict · Reflection return type · ext/hash

Problem

hash_algos() Reflection advertises array return, but sibling hash_hmac_algos() has no return type (ReflectionFunction::hasReturnType() === false). Zend stub is function hash_hmac_algos(): array. Probed 2026-08-06 VM @ bf5802236.

Function Zend Reflection return VM (2026-08-06)
hash_algos array array
hash_hmac_algos array <none>

Runtime list itself is fine (non-empty HMAC algo list).

php-src reference

PHP implementation target

  • ext/hash/ Module / Internal arginfo for hash_hmac_algos — add array return metadata to match hash_algos; PHP-only, no C

Repro

./script/docker-exec.sh -- bash -lc 'php bin/vm.php -r '\''
$r = new ReflectionFunction("hash_hmac_algos");
echo "hmac return=", $r->hasReturnType() ? (string)$r->getReturnType() : "NONE", "\n";
$r2 = new ReflectionFunction("hash_algos");
echo "algos return=", $r2->hasReturnType() ? (string)$r2->getReturnType() : "NONE", "\n";
'\'''

Done when

  • ReflectionFunction('hash_hmac_algos')->getReturnType() is array (matches hash_algos / Zend)
  • Compliance .phpt guard under test/compliance/cases/
  • php-src-strict; no php-compiler-strict shortcut

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machinebugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions