mirror of
https://github.com/php/php-src.git
synced 2024-12-17 05:50:14 +08:00
Writing to a proprety that hasn't been declared is deprecated, unless the class uses the #[AllowDynamicProperties] attribute or defines __get()/__set(). RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
21 lines
288 B
PHP
21 lines
288 B
PHP
--TEST--
|
|
Bug #78589: Memory leak with GC + __destruct()
|
|
--FILE--
|
|
<?php
|
|
|
|
class Test {
|
|
public $foo;
|
|
public function __destruct() {}
|
|
}
|
|
|
|
$test = new Test;
|
|
$test->foo = [&$test->foo];
|
|
$ary = [&$ary, $test];
|
|
unset($ary, $test);
|
|
gc_collect_cycles();
|
|
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
===DONE===
|