Skip to content

$o->p = &$v copies the value instead of binding the property to the variable. #345

Closed

Description

@blacktrs

Summary

$o->p = &$v copies the value instead of binding the property to the variable.

Repro

<?php
class O { public $p; function bind(&$v) { $this->p = &$v; } }
$o = new O; $x = "a"; $o->bind($x); $x = "b"; echo $o->p, "\n";
$y = "c"; $o->p = &$y; $y = "d"; echo $o->p, "\n";

Expected (php)

b
d

Actual (manticore ecbec1c2, Darwin arm64)

a
c

Tracking

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

    bugwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions