Commit e108190c8d8 for php
commit e108190c8d83c7d9e5efa6f419b1f7198413ffe0
Author: Florian Engelhardt <florian.engelhardt@datadoghq.com>
Date: Wed Dec 2 12:28:00 2026 +0100
fix gc threshold in repeated runs (#26027)
diff --git a/Zend/tests/gc_054.phpt b/Zend/tests/gc_054.phpt
index 2325c1320ff..a348eab588b 100644
--- a/Zend/tests/gc_054.phpt
+++ b/Zend/tests/gc_054.phpt
@@ -17,14 +17,16 @@ public function __destruct() {
$arr = [];
$arr[] = &$arr;
+$limit = gc_status()['threshold'];
+
try {
foreach ($arr as $v) {
// Only the foreach loop tmpvar keeps $arr alive now.
unset($arr, $v);
- // Fill the 10k root buffer to trigger GC directly from this user frame.
+ // Fill the root buffer to trigger GC directly from this user frame.
$keep = [];
- for ($i = 0; $i < 10000; $i++) {
+ for ($i = 0; $i < $limit; $i++) {
$a = new stdClass();
$keep[] = $a;
}