Skip to content

Dynamic property ops: $o->{e} = &$x does not bind, dim write is lost, unset is a no-op #34

Closed

Description

@blacktrs

Summary

Dynamic property ops: $o->{e} = &$x does not bind, dim write is lost, unset is a no-op.

Repro

<?php
$o = new stdClass;
$e = 'n';
$x = 1;
$o->{$e} = &$x;
$x = 2;
var_dump($o->n);
$o->{'m'} = [0];
$o->{'m'}[0] = 5;
var_dump($o->m[0]);
unset($o->{$e});
var_dump(isset($o->n));

Expected (php 8.5)

int(2)
int(5)
bool(false)

Actual (manticore 10affa68, macOS arm64)

int(1)
int(0)
bool(true)

Tracking

Known-bug repro: tests/aot/repro/wrong/dyn_prop_ops.php — bash tests/aot/xfail.sh -k dyn_prop_ops 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 5, 2026
  2. added
    area:refs
    on Oct 13, 2026
  3. blacktrs commented on Oct 13, 2026

    @blacktrs
    ContributorAuthor

    Partial (branch fix/batch-c). $o->{'m'}[0] = 5 and unset($o->{$e}) fixed. Still open: $o->{$e} = &$x bind — needs the 'ref-cell leftovers' work (=& on PropertyAccess), same family as #58. Repro trimmed to that part.

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:refsbugwrong-answer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions