downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

gc_enabled> <gc_disable
Last updated: Fri, 20 Nov 2009

view this page in

gc_enable

(PHP 5 >= 5.3.0)

gc_enableActivates the circular reference collector

Description

void gc_enable ( void )
Warning

This function is currently not documented; only its argument list is available.

Activates the circular reference collector.

Parameters

This function has no parameters.

Return Values

No value is returned.



add a note add a note User Contributed Notes
gc_enable
Anonymous
08-Apr-2009 05:43
This feature allows you to reuse previously emptied variables by  unset() or simply return to the previous value of a variable.

Their mode of use:

<?php

// Start caching variables
gc_enable ();

$value = "Hello world";

echo
$value. "</ br>";

$value = "Bye world";

echo
$value. "</ br>";

// Load the variables into garbage "Previous"

$previous = gc_collect_cycles();

// Get the previous value of "value" with old 0.
// 0 is the previous value, that means I take the first value "garbage" of the variable.

$value = $previous ['value'] [0]

//Get empty the garbage collection variable to disallow from the memory.
gc_disable($previous);

echo
$value. "</ br>";

/*
This would return:

Hello world
Bye world
Hello world
*/
?>

gc_enabled> <gc_disable
Last updated: Fri, 20 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites