Re: Class instance pointers

From: Date: Tue, 29 Nov 2011 17:09:09 +0000
Subject: Re: Class instance pointers
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-315875@lists.php.net to get a copy of this message
On 11/29/2011 7:56 AM, Tim Streater wrote: > Is there any benefit to setting a pointer to a class instance to null before returning from a > function? As in: > > function myfunc () > { > $p = new myclass (); > // do stuff > $p = null; > } > > Thanks. > > -- > Cheers -- Tim > > Nope, AFAIK everything inside the function will disappear when the function exits. Unless you run into one of the memory release issues talked about in the past, in that case you might be SOL. -- Jim Lucas http://www.cmsws.com/ http://www.cmsws.com/examples/ http://www.bendsource.com/ C - (541) 408-5189 O - (541) 323-9113 H - (541) 323-4219

« previous php.general (#315875) next »