--- /dev/null
-// TODO: The destructor *should* be running here, but doesn't.
-// This works in PHP >= 7.3 though.
-
+ --TEST--
+ Object properties HT may need to be removed from nested data
+ --FILE--
+ <?php
+
+ class Test {
+ public function __destruct() {
+ $GLOBALS['x'] = $this;
+ }
+ }
+
+ $t = new Test;
+ $t->x = new stdClass;
+ $t->x->t = $t;
+ $a = (array) $t->x;
+ unset($t, $a);
+ gc_collect_cycles();
+ var_dump($x);
+
---EXPECTF--
-Notice: Undefined variable: x in %s on line %d
-NULL
+ ?>
++--EXPECT--
++object(Test)#1 (1) {
++ ["x"]=>
++ object(stdClass)#2 (1) {
++ ["t"]=>
++ *RECURSION*
++ }
++}
ref = Z_COUNTED_P(zv);
goto tail_call;
}
- if (GC_ADDRESS(GC_INFO(ht)) != 0 && GC_REF_GET_COLOR(ht) == GC_BLACK) {
++ if (GC_REF_ADDRESS(ht) != 0 && GC_REF_CHECK_COLOR(ht, GC_BLACK)) {
+ GC_TRACE_REF(ht, "removing from buffer");
+ GC_REMOVE_FROM_BUFFER(ht);
+ }
} else {
return;
}