Category
php-in-php · stdlib · web runtime (#1492)
Problem
Mod-rewrite output var registration (output_add_rewrite_var(), output_reset_rewrite_vars()) has VM implementations in ext/standard/ backed by PHPCompiler\Web\ResponseContext, but JIT/AOT still emit lib/JIT/Builtin/RewriteVarsRuntime.php LLVM that mirrors a request-scoped global hashtable (phpc_rewrite_vars).
Duplicated semantics risk drift for web/AOT builds and extend C-style globals instead of PHP-owned state.
php-src reference
Repro
<?php
output_add_rewrite_var('SESSIONID', 'abc');
output_add_rewrite_var('NAME', 'value');
echo "ok\n";
./script/docker-exec.sh -- php bin/vm.php -r "output_add_rewrite_var('A','1'); echo 'ok';"
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/jit.php -r "output_add_rewrite_var('"'"'A'"'"','"'"'1'"'"'); echo '"'"'ok'"'"';"'
VM path passes today; JIT must call the same PHP helper rather than LLVM table walks.
Scope (this repo)
| Layer |
Path |
| VM SSOT |
ext/standard/output_add_rewrite_var.php, output_reset_rewrite_vars.php, lib/Web/ResponseContext.php |
| LLVM today |
lib/JIT/Builtin/RewriteVarsRuntime.php |
| Wire-up |
JIT builtin registration → PHP trampoline; delete LLVM bodies |
Done when
Related
Category
php-in-php·stdlib· web runtime (#1492)Problem
Mod-rewrite output var registration (
output_add_rewrite_var(),output_reset_rewrite_vars()) has VM implementations inext/standard/backed byPHPCompiler\Web\ResponseContext, but JIT/AOT still emitlib/JIT/Builtin/RewriteVarsRuntime.phpLLVM that mirrors a request-scoped global hashtable (phpc_rewrite_vars).Duplicated semantics risk drift for web/AOT builds and extend C-style globals instead of PHP-owned state.
php-src reference
ext/standard/url.c—PHP_FUNCTION(output_add_rewrite_var),PHP_FUNCTION(output_reset_rewrite_vars)main/php_output.h— rewrite var tableRepro
VM path passes today; JIT must call the same PHP helper rather than LLVM table walks.
Scope (this repo)
ext/standard/output_add_rewrite_var.php,output_reset_rewrite_vars.php,lib/Web/ResponseContext.phplib/JIT/Builtin/RewriteVarsRuntime.phpDone when
output_add_rewrite_var/output_reset_rewrite_varsinvokeResponseContextvia PHP (thin ABI only)RewriteVarsRuntime.phpdeleted or ≤ link stubtest/compliance/cases/stdlib/output_rewrite_var*.phpt(VM + JIT variants) greenRelated