Skip to content

A property store never releases the old value when the property is a method-call receiver #24

Closed

Description

@blacktrs

Summary

A property store never releases the old value when the property is a method-call receiver.

Already fixed on branch ownership-2; closes when that branch lands on main. Tracking only.

Repro

<?php
class A { public static $live = 0; public function __construct() { self::$live++; } public function __destruct() { self::$live--; } public function n() {} }
final class P1 { private A $a; public function run() { $this->a = new A(); $this->a->n(); } }
$p = new P1;
for ($i = 0; $i < 100; $i++) { $p->run(); }
echo A::$live, "\n";

Expected (php 8.5)

1

Actual (manticore 10affa68, macOS arm64)

100

Tracking

Known-bug repro: tests/aot/repro/leak/prop_store_method_receiver.php — bash tests/aot/xfail.sh -k prop_store_method_receiver 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

    bugleak

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions