views:

84

answers:

2

Hi,

I have an list of items that is stored in the $_SERVER["my_key"]. Are these items garbage collected automatically?

+2  A: 

If there's nothing referencing the list (e.g. when you unset($_SERVER['my_key'])), it will be GC'd sooner or later (at the latest, when your script terminates).

Piskvor
+1  A: 

$_SERVER is a superglobal array and all values in this array will be the one and only time garbage collected when the script finishes execution.

Tobias P.