note 90163 added to function.gc-enable
| From: | Anonymous at osu1 dot php dot net | Date: | Wed, 08 Apr 2009 15:43:50 +0000 |
| Subject: | note 90163 added to function.gc-enable | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152965@lists.php.net to get a copy of this message | ||
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
*/
?>
----
Server IP: 69.147.83.197
Probable Submitter: 190.134.35.89
----
Manual Page -- http://www.php.net/manual/en/function.gc-enable.php
Edit -- https://master.php.net/note/edit/90163
Del: integrated -- https://master.php.net/note/delete/90163/integrated
Del: useless -- https://master.php.net/note/delete/90163/useless
Del: bad code -- https://master.php.net/note/delete/90163/bad+code
Del: spam -- https://master.php.net/note/delete/90163/spam
Del: non-english -- https://master.php.net/note/delete/90163/non-english
Del: in docs -- https://master.php.net/note/delete/90163/in+docs
Del: other reasons-- https://master.php.net/note/delete/90163
Reject -- https://master.php.net/note/reject/90163
Search -- https://master.php.net/manage/user-notes.php