Skip to content

A by-ref write that changes the caller variable's type answers an address #31

Closed

Description

@blacktrs

Summary

A by-ref write that changes the caller variable's type answers an address.

Also listed in the docs/ROADMAP.md Tier 1 gap matrix.

Repro

<?php
function w(mixed &$v): void { $v = "s"; }
$x = 1;
w($x);
var_dump($x);
function f(&$x) { $x = 5; }
foreach ([new stdClass] as $d) {}
f($d);
var_dump($d);

Expected (php 8.5)

string(1) "s"
int(5)

Actual (manticore 10affa68, macOS arm64)


[exit code 139 — SIGSEGV]

Tracking

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

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