--TEST-- GC can cleanup cycle when fiber result references fiber --EXTENSIONS-- fiber --FILE-- fiber = $fiber; } public function __destruct() { var_dump('DTOR'); } }; }); $fiber->start(); var_dump('COLLECT CYCLES'); gc_collect_cycles(); var_dump('DONE'); var_dump($fiber->isTerminated()); unset($fiber); var_dump('COLLECT CYCLES'); gc_collect_cycles(); var_dump('DONE'); ?> --EXPECT-- string(14) "COLLECT CYCLES" string(4) "DONE" bool(true) string(14) "COLLECT CYCLES" string(4) "DTOR" string(4) "DONE"