Skip to content

Stdlib: HashContext::__debugInfo() — hide hash state (#7084) - #7816

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-7084-hash-context-debug-info
Jun 9, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-7084-hash-context-debug-info

Conversation

@PurHur

@PurHur PurHur commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Register HashContext::__debugInfo() VM builtin returning ['algo' => '<name>'] only (php-src ext/hash/hash.c ZEND_METHOD(HashContext, __debugInfo)).
  • Add VmHashNative::resolveAlgoName() for canonical registered algorithm names.
  • Compliance + unit tests guard var_dump redaction.

Closes #7084

php-src reference

  • ext/hash/hash.c — ZEND_METHOD(HashContext, __debugInfo) exposes hash->ops->algo only
  • PHP implementation: ext/hash/HashContextDebugInfo.php, ext/hash/VmHashContext.php

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter hash_context_debug_info'
# OK (3 tests, 3 assertions)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit --filter HashModuleTest'
# OK (4 tests, 10 assertions)

AOT note: Incremental hash API (hash_init/hash_update/…) remains VM-only (#7174); __debugInfo is a VmClassMethod on the same path — no new C runtime or AOT stub surface.

Made with Cursor

Register VM builtin __debugInfo on HashContext so var_dump hides digest
state and matches php-src ext/hash/hash.c debug_info handler.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 175ff0a into master Jun 9, 2026
@PurHur
PurHur deleted the agent/issue-7084-hash-context-debug-info branch June 9, 2026 17:22
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: HashContext::__debugInfo() — PHP 8.4 var_dump must hide hash state (ext/hash/hash.c, pairs #3357)

1 participant