Skip to content

(array) of a value typed by an interface (Throwable or a user interface) answers a garbage array or crashes. #255

Closed

Description

@blacktrs

Summary

(array) of a value typed by an interface (Throwable or a user interface) answers a garbage array or crashes.

Repro

<?php
interface I {}
class C implements I { public $a = 1; protected $b = 2; }
function mk(): I { return new C; }
function mt(): Throwable { return new RuntimeException("x"); }
echo count((array) mk()), "\n";
echo count((array) mt()), "\n";

Expected (php)

2
7

Actual (manticore fd82c7dd, Darwin arm64)


[exit code 139 — SIGSEGV]

Tracking

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