Category
runtime
Problem
gc_collect_cycles() is not available. Zend’s refcount + cycle collector frees unreachable object graphs; long-lived apps and tests call it explicitly. This compiler exposes a WeakReference subset (#1366) without a public sweep entry point.
php-src reference
Zend/zend_gc.c — gc_collect_cycles(), zend_gc_collect_cycles()
ext/standard/info.c — PHP_FUNCTION(gc_collect_cycles)
Repro (today)
<?php
class Node { public ?Node $next = null; }
$a = new Node();
$b = new Node();
$a->next = $b;
$b->next = $a;
unset($a, $b);
echo gc_collect_cycles();
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php repro.php'
Zend PHP: integer ≥ 1 (cycles collected)
This compiler: Call to undefined function gc_collect_cycles()
Scope
ext/standard/gc_collect_cycles.php + Module.php
- VM: hook into object refcount / cycle buffer (implement real collector or document v1 stub with follow-up)
test/compliance/cases/runtime/gc_collect_cycles.phpt
Done when
Links
Category
runtimeProblem
gc_collect_cycles()is not available. Zend’s refcount + cycle collector frees unreachable object graphs; long-lived apps and tests call it explicitly. This compiler exposes aWeakReferencesubset (#1366) without a public sweep entry point.php-src reference
Zend/zend_gc.c—gc_collect_cycles(),zend_gc_collect_cycles()ext/standard/info.c—PHP_FUNCTION(gc_collect_cycles)Repro (today)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php repro.php'Zend PHP: integer ≥ 1 (cycles collected)
This compiler:
Call to undefined function gc_collect_cycles()Scope
ext/standard/gc_collect_cycles.php+Module.phptest/compliance/cases/runtime/gc_collect_cycles.phptDone when
./script/ci-fast.sh --filter gc_collect_cyclesgreenLinks