Skip to content

An array stored through $GLOBALS and bound by global is typed int in MIR, so copying it prints its address as an int. #87

Closed

Description

@blacktrs

Summary

An array stored through $GLOBALS and bound by global is typed int in MIR, so copying it prints its address as an int.

Repro

<?php
$GLOBALS['gi2'] = [0, 1];
function g2() { global $gi2; $x = $gi2; return $x; }
var_dump(g2());

Expected (php)

array(2) {
  [0]=>
  int(0)
  [1]=>
  int(1)
}

Actual (manticore 3dc6ed40, Darwin arm64)

int(4308247888)

Tracking

Known-bug repro: tests/aot/repro/wrong/global_int_array_typed_int.php — bash tests/aot/xfail.sh -k global_int_array_typed_int 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 a commit that references this issue on Oct 13, 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