Skip to content

Regression: hash/hash_hmac(null $data) still coerce under PROFILE=8.4 — Zend TypeError (ext/hash/hash.stub.php) #28894

Description

@PurHur

Category

Regression · php-src-strict · PHP 8.4 null→TypeError

Problem

hash() / hash_hmac() still accept null for $data under PHP_COMPILER_PROFILE=8.4 (DEP + hash of empty string) instead of TypeError as Zend 8.4+. Not covered by open string-null batches (#28885/#28875/…).

Verified 2026-08-08 with PHP_COMPILER_PROFILE=8.4 php bin/vm.php.

Repro Zend 8.4+ VM PROFILE=8.4 (2026-08-08)
hash('sha1', null) TypeError DEP + da39a3ee5e6b4b0d3255bfef95601890afd80709
hash_hmac('sha1', null, 'k') TypeError DEP + hmac of ""

php-src reference

PHP implementation target

  • PROFILE≥8.4 null reject on hash $data via shared string-arg guards in ext/hash / ext/standard PHP + JIT lowering; no new C runtime logic

Repro

PHP_COMPILER_PROFILE=8.4 ./script/docker-exec.sh -- bash -lc \
  'php bin/vm.php test/repro/maintainer_gap_hash_null_typeerror_84.php'

Done when

  • hash('sha1', null) and hash_hmac('sha1', null, 'k') throw TypeError under PROFILE=8.4/8.5
  • Compliance / repro guard
  • 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