Re: [PHP-DEV] Re: PHP 4.0 Bug #5289 Updated: Use of reset on a global From: php4 <email protected>
Date: 06/30/00

Addressed to: alan.frostick <email protected>
              php-dev <email protected>

** Reply to note from Alan Frostick <alan.frostick <email protected>> Fri, 30 Jun 2000 13:07:26 +0200
>
> Yes Rick, I thought of that one myself last night (are we telepathic?)
>
> Can anyone tell me if there's any memory penalty in doing this instead
> of using unset()? (the arrays iteratively replaced could be quite
> chunky).

I don't think so. If there are no other referenced to the old array
PHP's reference conter should identify the fact that the old values are
no longer being used, and delete them.

> If there is no downside, replacing the arrays by simple re-assignment
> to an empty array would be the best solution. It remains a difference
> between php3 and php4, meaning I have to devise a global search for
> any such use of unset() in all my projects...

from the shell prompt, in the directory with your source:

   grep unset *

grep - search

unset - for 'unset'

* - in all files in this directory

see man grep for more. (much more)

Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>