Re: Re: PHP 4.0 Bug #5289 Updated: Use of reset on a global array creates
| From: | php4 at developersdesk dot com | Date: | Thu, 29 Jun 2000 18:05:22 +0000 |
| Subject: | Re: Re: PHP 4.0 Bug #5289 Updated: Use of reset on a global array creates | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-22993@lists.php.net to get a copy of this message | ||
Addressed to: alan.frostick@iconmedialab.com
Bug Database <php-dev@lists.php.net>
** Reply to note from Alan Frostick <alan.frostick@iconmedialab.com> Thu, 29 Jun 2000 22:05:54
+0200
>
> That may be the new definition, but it wasn't the case under php3. I
> didn't spot anything in your differences notes for this.
>
> My code fragment just highlights the
> problem, it's actually gleaned from debugging a much larger and
> complex script. What I want to do is replace an array with fresh
> contents when a loading function is invoked. This is most simply done
> by using unset.
> Is there a better way to do it?
<Wild Guess Alert!>
Have you considered:
function whatever() {
global $MyGlobalArray;
$MyGlobalArray = array();
..
..
..
}
Don't unset it, just replace its contents with an empty array...
</Wild Guess Alert!>
Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com