Skip to content

php-in-php: getenv_all shares EnvironMirrorRuntime thin kernel ABI (#21579) - #21585

Merged
PurHur merged 1 commit into
masterfrom
agent/runtime-php-getenv-all-environ-mirror
Jul 20, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/runtime-php-getenv-all-environ-mirror

Conversation

@PurHur

@PurHur PurHur commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #21579

php-src reference

  • ext/standard/basic_functions.c — zif_getenv argc==0
  • sapi/cli/php_cli.c — environ → $_SERVER

Lines / surface

  • Removed inline JitEnvironMirrorKernel::mirrorIntoHashtablePtr from StringGetenvAll (~getenv_all bridge duplication).
  • Kernel retained once in EnvironMirrorRuntime::implementThinKernelBridge for thin AOT (not deleted — NestedJIT leaf still needed for embed/phpc_native_environ_mirror_into_ht).

Verification

./script/phpunit.sh --filter 'GetenvJitRuntimeShrinkTest|EnvironMirrorRuntimeShrinkTest|StringGetenvAllRuntimeStandaloneTest'
# OK (13 tests, 1 skipped)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/compile.php -o /tmp/ge test/repro/issue_21579_getenv_only.php && /tmp/ge'
# array / nonempty / has / production / done  EXIT:0

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && make bootstrap-selfhost-vm-driver-execute-probe'
# OK

php script/bootstrap-inventory.php --check
# OK 6197/6197

Note: AotTest dataset getenv_all still misses APP_DEBUG/putenv overlay lines on master and this branch alike (pre-existing harness/--ENV-- overlay gap — not regressed; PATH/HOME environ fill is green).

Made with Cursor

…21579)

Route zero-arg getenv() through __superglobals__mirror_process_environ.
Thin standalone AOT uses JitEnvironMirrorKernel in EnvironMirrorRuntime
(NestedJIT helper is empty under thin AOT); embed keeps NestedJIT helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 1a7bacc into master Jul 20, 2026
1 check failed
@PurHur
PurHur deleted the agent/runtime-php-getenv-all-environ-mirror branch July 20, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant