Re: Garbage Collection?
| From: | Rasmus Lerdorf | Date: | Wed, 21 Aug 2002 12:25:43 +0000 |
| Subject: | Re: Garbage Collection? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-113431@lists.php.net to get a copy of this message | ||
> Hi everybody,
>
> Is there any requirement to free variables in php, or is there any
> garbage collection or built-in module that terminates unused variables?
> (Especially for arrays and class instances)...
Garbage collection is automatic in PHP. When you do:
$a = 123;
$a = 456;
Then the memory for 123 is returned to the system as soon as you re-assign
$a. You can also return it by doing unset($a);
-Rasmus