Skip to content

Array === on a value read back from an object property is false once ReflectionClass is in the program #514

Closed

Description

@blacktrs

Summary

Array === on a value read back from an object property is false once ReflectionClass is in the program.

Repro

<?php
final class L
{
    /** @var string[] */
    public array $a;
    /** @param string[] $a */
    public function __construct(array $a) { $this->a = $a; }
}
function cls(object $n): string
{
    return (new \ReflectionClass($n))->getShortName();
}
$p = ['a'];
$l = new L($p);
var_dump($l->a === $p);

Expected (php)

bool(true)

Actual (manticore 89904aad, Darwin arm64)

bool(false)

Tracking

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