Skip to content

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

Closed

Description

@PurHur

Category

language · php-src-strict · PHP 8.4 forward profile

Problem

PHP 8.4 allows named parameters on exit/die (exit(status: 0)). With PHP_COMPILER_PROFILE=8.4, this compiler accepts and runs the form; on the default reference profile it fails at parse time (unexpected token ":"). Forward-profile gating should not block syntax that Zend 8.4 accepts when the compilation unit targets 8.4 semantics.

Repro Zend 8.4 VM default profile (2026-07-10) VM PHP_COMPILER_PROFILE=8.4
exit(status: 0); exit 0 syntax error, unexpected token ":" exit 0

php-src reference

PHP implementation target

  • lib/ parser/compile — accept exit(status:) / die(status:) on PHP 8.4 forward profile without requiring ad-hoc env at parse time when project profile is 8.4
  • Lowering in PHP (ext/standard exit/die builtins), not new C runtime branches

Repro

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_exit_named_status.php'  # expect fail today
PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/maintainer_gap_exit_named_status.php  # expect exit 0

Done when

  • test/repro/maintainer_gap_exit_named_status.php and maintainer_gap_die_named_status.php succeed under PHP 8.4 profile without parse errors on default when profile requests 8.4
  • Compliance guard under test/compliance/cases/language/exit_die_named_status_84.phpt
  • php-src-strict on 8.4 profile; no php-compiler-strict shortcut

Activity

  1. added
    enhancementNew feature or request
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Jul 10, 2026
  2. PurHur commented on Jul 10, 2026

    @PurHur
    OwnerAuthor

    claim: worker-lane-c — starting this run

  3. PurHur commented on Jul 10, 2026

    @PurHur
    OwnerAuthor

    Merged via #17685

    Fix: LanguageProfileScope applies phpc.json languageProfile or // php-compiler-language-profile=8.4 before preprocess gates; supportsExitFunctionForm() aligned with other 8.4 forward-profile syntax gates.

    Verification:

    • php bin/vm.php test/repro/maintainer_gap_exit_named_status.php → exit 0 (no CLI env)
    • php bin/vm.php test/repro/maintainer_gap_die_named_status.php → exit 1
    • vendor/bin/phpunit --filter LanguageProfileScopeTest → OK (3 tests)
    • vendor/bin/phpunit --filter "exit_die_named_status_84|exit_named_status_reference" test/compliance/VMTest.php → OK (2 tests)
    • php script/bootstrap-inventory.php --check → OK 4338/4338
    • make bootstrap-selfhost-vm-driver-execute-probe → OK
  4. PurHur commented on Jul 10, 2026

    @PurHur
    OwnerAuthor

    claim: cursor-agent-lane-b — spine coverage follow-up for lib/LanguageProfileScope.php (#17685 merge left check-selfhost-spine-coverage-sync red)

  5. PurHur commented on Jul 10, 2026

    @PurHur
    OwnerAuthor

    Merged via #17692.

    Fix: Added lib/LanguageProfileScope.php to the M2 self-host spine bundle (4337→4338). Regenerated bootstrap inventory/profile and updated spine footnotes.

    Verification:

    php script/check-selfhost-spine-coverage-sync.php  # OK 4338/4338
    php script/check-selfhost-spine-count-sync.php     # OK 4338/4338
    make bootstrap-selfhost-vm-driver-execute-probe    # OK
    BOOTSTRAP_ALLOW_STALE_SIDECAR=1 make north-star5-verify-fast  # OK
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITenhancementNew feature or requestimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-2:languagePhase 2 – language features

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions