Skip to content

A reference bound on one branch only (if ($c) { $p = &$x; } $p = 5;) aliases on every path: the false path writes $x too. #445

Closed

Description

@blacktrs

Summary

A reference bound on one branch only (if ($c) { $p = &$x; } $p = 5;) aliases on every path: the false path writes $x too.

Repro

<?php
function t(bool $c): void { $x = 1; $p = 0; if ($c) { $p = &$x; } $p = 5; var_dump($x, $p); }
t(false); t(true);

Expected (php)

int(1)
int(5)
int(5)
int(5)

Actual (manticore d08c28c6, Darwin arm64)

int(5)
int(5)
int(5)
int(5)

Tracking

Known-bug repro: tests/aot/repro/wrong/ref_alias_conditional_branch.php — bash tests/aot/xfail.sh -k ref_alias_conditional_branch 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
    wrong-answer
    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

    bugwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions