Category
php-in-php · bootstrap
Problem
hash() / hash_hmac() VM builtins delegate to host \hash() / \hash_hmac() in ext/standard/VmHash.php (issue #179). Separately, AOT/JIT still link lib/AOT/runtime/hash_crypto.c for native digest symbols. Self-host (#4790) needs pure-PHP (or compiled-PHP) digests; once VmHash is native, hash_crypto.c must be deleted — not extended with new algorithms.
php-src reference
Repro (dual path today)
grep hash_crypto lib/AOT/Linker.php
head -25 ext/standard/VmHash.php # host \\hash() delegation
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php -r "echo hash(\"sha256\",\"x\");"'
| Layer |
Today |
| VM |
Host \hash() via VmHash.php |
| AOT link |
hash_crypto.c compiled into binary |
Scope (this repo)
| Area |
Files |
| VM |
ext/standard/VmHash.php — native sha256/sha1/md5 (coordinate #4790) |
| Delete C |
lib/AOT/runtime/hash_crypto.c, lib/AOT/Linker.php entry |
| JIT |
any lib/JIT/Builtin/*Hash* handlers — PHP lowering only |
| Tests |
existing hash PHPTs + bootstrap inventory |
Done when
Dependencies
Links
Category
php-in-php·bootstrapProblem
hash()/hash_hmac()VM builtins delegate to host\hash()/\hash_hmac()inext/standard/VmHash.php(issue #179). Separately, AOT/JIT still linklib/AOT/runtime/hash_crypto.cfor native digest symbols. Self-host (#4790) needs pure-PHP (or compiled-PHP) digests; once VmHash is native,hash_crypto.cmust be deleted — not extended with new algorithms.php-src reference
ext/hash/hash.c—php_hashAPIext/hash/hash_sha.c— sha256/sha1/md5Repro (dual path today)
\hash()viaVmHash.phphash_crypto.ccompiled into binaryScope (this repo)
ext/standard/VmHash.php— native sha256/sha1/md5 (coordinate #4790)lib/AOT/runtime/hash_crypto.c,lib/AOT/Linker.phpentrylib/JIT/Builtin/*Hash*handlers — PHP lowering onlyDone when
hash('sha256', $data)works on VM without hosthashextensionhash_crypto.cremoved; AOT link succeeds./script/ci-local.sh --filter hashgreen (or targeted hash tests)Dependencies
Links