Skip to content

(object) cast of an int-valued array literal leaks its property bag. #261

Closed

Description

@blacktrs

Summary

(object) cast of an int-valued array literal leaks its property bag.

Repro

<?php
function t(): int { $x = (object)["a" => 1]; return 1; }
t();
$b = memory_get_usage();
for ($i = 0; $i < 50000; $i++) { t(); }
echo (memory_get_usage() - $b) < 500000 ? "flat" : "leak", "\n";

Expected (php)

flat

Actual (manticore 00b756b9, Darwin arm64)

leak

Tracking

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

    bugleak

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions