Skip to content

A dynamic property store and a foreach over an object from an array of objects of different classes SIGSEGVs. #126

Closed

Description

@blacktrs

Summary

A dynamic property store and a foreach over an object from an array of objects of different classes SIGSEGVs.

Repro

<?php
#[AllowDynamicProperties]
final class P { public int $a = 1; }
foreach ([new P(), (object) ['x' => 1]] as $o) {
    $o->{'z'} = 'zed';
    $n = 0;
    foreach ($o as $k => $v) {
        echo $k, '=', $v, "\n";
        if (++$n >= 10) { break; }
    }
    echo "count $n\n";
}

Expected (php)

a=1
z=zed
count 2
x=1
z=zed
count 2

Actual (manticore 46bda0f8, Darwin arm64)


[exit code 139 — SIGSEGV]

Tracking

Known-bug repro: tests/aot/repro/crash/foreach_mixed_class_objects_after_dynamic_store.php — bash tests/aot/xfail.sh -k foreach_mixed_class_objects_after_dynamic_store reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.

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