Skip to content

Reading $obj[0] on an object whose class lacks ArrayAccess crashes (SIGBUS) instead of throwing Error #479

Closed

Description

@blacktrs

Summary

Reading $obj[0] on an object whose class lacks ArrayAccess crashes (SIGBUS) instead of throwing Error.

Repro

<?php
class C { public int $x = 1; }
$c = new C;
try {
    var_dump($c[0]);
} catch (Error $e) {
    echo get_class($e), ': ', $e->getMessage(), "\n";
}

Expected (php)

Error: Cannot use object of type C as array

Actual (manticore 9f2c1322, Darwin arm64)


[exit code 138 — SIGBUS]

Tracking

Known-bug repro: tests/aot/repro/crash/object_offset_without_arrayaccess.php — bash tests/aot/xfail.sh -k object_offset_without_arrayaccess 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
    crash
    on Oct 25, 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

    bugcrash

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions