返回循環引用計數器的狀態

gc_enabled

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

gc_enabled返回循環引用計數器的狀態

說明

gc_enabled(): bool

返回循環引用計數器的狀態。

參數

此函式沒有參數。

返回值

如果垃圾收集器已啟用則返回 true,否則返回 false

範例

示例 #1 一個 gc_enabled() 例子

<?php
if(gc_enabled()) gc_collect_cycles();
?>

Leave a Reply

Your email address will not be published. Required fields are marked *