Re: Re: [PHP] Class instance pointers
| From: | Tim Streater | Date: | Tue, 29 Nov 2011 17:16:00 +0000 |
| Subject: | Re: Re: [PHP] Class instance pointers | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-315876@lists.php.net to get a copy of this message | ||
On 29 Nov 2011 at 17:01, cimodev <cimodev@googlemail.com> wrote:
> Am 29.11.2011 16:56, schrieb Tim Streater:
>> 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;
>> }
> No!
> In this case the GC will do that for you :)
Thanks, I expected that to be the case, but it's not been crucial up to now. Rather than having
a script that runs for a while and quits, I'm hoping to run a small server written in PHP and
wanted to be 100% sure that I didn't need to.
--
Cheers -- Tim