Skip to content

A string value read from an array<int, mixed> and stored into a bare-array parameter reads back as 0 #161

Closed

Description

@blacktrs

Summary

A string value read from an array<int, mixed> and stored into a bare-array parameter reads back as 0.

Repro

<?php
class Dbg {
    /** @return array<int, mixed> */
    public function __debugInfo(): array { return [1, 'x']; }
}
function cast(object $obj, array $a): array {
    $debugInfo = $obj->__debugInfo();
    foreach ($debugInfo as $k => $v) {
        $a['v' . $k] = $v;
    }
    return $a;
}
echo json_encode(cast(new Dbg(), ['p' => 1])), "\n";

Expected (php)

{"p":1,"v0":1,"v1":"x"}

Actual (manticore 600827e7, Darwin arm64)

{"p":1,"v0":1,"v1":0}

Tracking

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