Skip to content

Passing an undefined variable by reference to a method on a Class|false receiver fails MIR.verify (dangling local) #339

Closed

Description

@blacktrs

Summary

Passing an undefined variable by reference to a method on a Class|false receiver fails MIR.verify (dangling local).

Repro

<?php
class A { function m(&$o) { $o = 1; } }
function mk(): A|false { return new A; }
$a = mk();
$a->m($x);
var_dump($x);

Expected (php)

int(1)

Actual (manticore e451c4c9, Darwin arm64)

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

Tracking

Known-bug repro: tests/aot/repro/crash/byref_arg_union_receiver.php — bash tests/aot/xfail.sh -k byref_arg_union_receiver 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 18, 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