Skip to content

define() with a run-time value (a $argv read) is inlined at its use sites, so a function using the constant fails MIR.verify (dangling local). #435

Closed

Description

@blacktrs

Summary

define() with a run-time value (a $argv read) is inlined at its use sites, so a function using the constant fails MIR.verify (dangling local).

Repro

<?php
define('FIRST', $argv[1] ?? 'none');
function f(): string { return FIRST; }
echo f(), "\n";

Expected (php)

none

Actual (manticore d37db0a2, Darwin arm64)

compile failed (rc=65):
compile failed: MIR.verify: dangling local $argv read in f but never defined
compile: front-end (parse/typeck/IR) returned null (rc=65)

Tracking

Known-bug repro: tests/aot/repro/crash/define_runtime_value_in_function.php — bash tests/aot/xfail.sh -k define_runtime_value_in_function reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.

Activity

  1. added
    bug
    crash
    on Oct 24, 2026
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

    bugcrash

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions