Category
php-in-php · php-src-strict
Problem
Process-local environment overlay for putenv() / getenv() is implemented in PHP (ext/standard/VmEnv.php), but JIT/AOT still link lib/JIT/Builtin/StringEnvLocal.php (~440 lines) reimplementing phpc_env_local_* hashtable logic in LLVM (replaces deleted lib/AOT/runtime/phpc_env_local.c).
CGI/superglobal refresh and self-host probes depend on consistent env semantics across VM/JIT/AOT.
php-src reference
Repro
Save as test/repro/maintainer_putenv_getenv_jit.php:
<?php
putenv('PHPC_TEST_ENV=1');
var_export(getenv('PHPC_TEST_ENV'));
echo "\n";
putenv('PHPC_TEST_ENV');
var_export(getenv('PHPC_TEST_ENV'));
echo "\n";
putenv('PHPC_TEST_ENV=2');
var_export(getenv('PHPC_TEST_ENV'));
echo "\n";
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/repro/maintainer_putenv_getenv_jit.php
php bin/jit.php test/repro/maintainer_putenv_getenv_jit.php
'
| Step |
Zend |
VM today |
JIT today (gap) |
| set + get |
'1' |
OK |
must match after migration |
unset via putenv('NAME') |
false |
OK |
must match |
| reset |
'2' |
OK |
must match |
Scope
| Path |
Work |
ext/standard/EnvLocalJitHelper.php (new) |
Bridge calling VmEnv overlay SSOT |
lib/JIT/Builtin/StringEnvLocal.php |
Thin ABI; delete 256-entry LLVM table |
lib/JIT/Builtin/JitEnv.php (if present) |
Wire helper |
| Tests |
test/compliance/cases/stdlib/putenv_getenv_jit.phpt |
Done when
Related
Category
php-in-php· php-src-strictProblem
Process-local environment overlay for
putenv()/getenv()is implemented in PHP (ext/standard/VmEnv.php), but JIT/AOT still linklib/JIT/Builtin/StringEnvLocal.php(~440 lines) reimplementingphpc_env_local_*hashtable logic in LLVM (replaces deletedlib/AOT/runtime/phpc_env_local.c).CGI/superglobal refresh and self-host probes depend on consistent env semantics across VM/JIT/AOT.
php-src reference
ext/standard/basic_functions.c—PHP_FUNCTION(putenv),PHP_FUNCTION(getenv)main/php_variables.c—EG(env)overlayRepro
Save as
test/repro/maintainer_putenv_getenv_jit.php:'1'putenv('NAME')false'2'Scope
ext/standard/EnvLocalJitHelper.php(new)VmEnvoverlay SSOTlib/JIT/Builtin/StringEnvLocal.phplib/JIT/Builtin/JitEnv.php(if present)test/compliance/cases/stdlib/putenv_getenv_jit.phptDone when
StringEnvLocal.phpbridge-only (−350+ LLVM lines)phpc_env_local.c./script/ci-fast.sh --filter putenv_getenvgreenRelated