R P,

 

I wasn't aware that they cleaned automatically(still learning)

 

From: r p [mailto:four.zero.one.unauthori...@gmail.com] 
Sent: 14 April 2012 00:10
To: Gavin
Cc: php-windows@lists.php.net
Subject: Re: [PHP-WIN] unsetting variables

 

You could do something like this...

    foreach (get_defined_vars() as $var => $val) {
        unset($$var, $var, $val);
    }

But this would be completely unnecessary and redundant.  At the end of a 
function or on return, all variables and internal reference counts within the 
scope of the function are essentially cleaned up or removed automatically, and 
garbage collection takes care of it from there (see: 
http://us.php.net/manual/en/features.gc.refcounting-basics.php). What 
specifically are you trying to accomplish or what problem are you facing?





On Mon, Apr 9, 2012 at 12:01 PM, Gavin <gavin.chalk...@gmail.com> wrote:

Hello All,

Is there a way to unset all variables within a function?

Or has this got to be done on an individual basis?

-- 



Best Regards,
 
Gavin Chalkley
 
 

 

Reply via email to