Skip to content

Language: exit(status:)/die(status:) without CLI profile env (#17681) - #17685

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-17681-exit-die-named-status-profile
Jul 10, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-17681-exit-die-named-status-profile

Conversation

@PurHur

@PurHur PurHur commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Root cause

exit(status:) / die(status:) required PHP_COMPILER_PROFILE=8.4 on the CLI even when the compilation unit declared a forward profile target. Preprocess rejectors ran before any per-file profile hint could take effect.

php-src reference

  • Zend/zend_compile.c — exit/die named arg parsing (PHP 8.4)
  • ext/standard/basic_functions.c — exit/die handlers

PHP implementation

  • lib/LanguageProfileScope.php — per-unit profile scope (phpc.json + pragma)
  • lib/Web/ProjectManifest.php — resolveLanguageProfile()
  • lib/Runtime.php — scope around prepareSourceForParser()
  • lib/CompilerVersion.php — gate alignment

Verification

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_exit_named_status.php; echo EXIT:$?'
# EXIT:0

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_die_named_status.php; echo EXIT:$?'
# EXIT:1

./script/docker-exec.sh -- bash -lc 'vendor/bin/phpunit --filter LanguageProfileScopeTest'
# OK (3 tests, 9 assertions)

./script/docker-exec.sh -- bash -lc 'vendor/bin/phpunit --filter "exit_die_named_status_84|exit_named_status_reference" test/compliance/VMTest.php'
# OK (2 tests, 2 assertions)

./script/docker-exec.sh -- bash -lc 'php script/bootstrap-inventory.php --check'
# OK 4338/4338

./script/docker-exec.sh -- bash -lc 'make bootstrap-selfhost-vm-driver-execute-probe'
# bootstrap-selfhost-vm-driver-execute-probe: OK

Closes #17681

Made with Cursor

Apply per-compilation-unit language profile from phpc.json languageProfile
or a source pragma before preprocess gates, and align supportsExitFunctionForm
with other 8.4 forward-profile syntax gates.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 4f50be7 into master Jul 10, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-17681-exit-die-named-status-profile branch July 10, 2026 18:45
PurHur added a commit that referenced this pull request Jul 10, 2026
…17689)

PR #17685 merged LanguageProfileScope but omitted the self-host spine
require; restore coverage sync and add die/pragma compliance + manifest tests.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur added a commit that referenced this pull request Jul 10, 2026
Add lib/LanguageProfileScope.php to compiler_lib_spine_smoke and refresh
gen-0 sidecar stamp + bootstrap inventory so ci-fast spine/inventory gates
stay green after the per-unit language profile hook landed in Runtime.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur added a commit that referenced this pull request Jul 10, 2026
…17692)

#17685 introduced lib/LanguageProfileScope.php for per-unit language profile
scoping but omitted it from the M2 spine bundle, leaving
check-selfhost-spine-coverage-sync red (4337/4338).

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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.

Language: exit(status:)/die(status:) named parameters — parse error without PHP_COMPILER_PROFILE=8.4 (Zend/zend_compile.c)

1 participant