HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

gc_enabled

Description

The gc_enabled of Options / Information for PHP returns status of the circular reference collector.

Syntax

gc_enabled(): bool

Return

Returns true if the garbage collector is enabled, false otherwise.

Examples

1 · disable

<?

gc_disable();

$return = gc_enabled();

var_export($return);
false

2 · enable

<?

gc_enable();

$return = gc_enabled();

var_export($return);
true

3

<?

if(gc_enabled())
{
    $return = gc_collect_cycles();

    echo $return;
}
0