Re: PHP 4.0 Bug #2109: Memory leak in each()

From: Date: Fri, 20 Aug 1999 13:51:31 +0000
Subject: Re: PHP 4.0 Bug #2109: Memory leak in each()
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-3610@lists.php.net to get a copy of this message
hi, gives the same leak on my machine (latest CVS) - (andrey, are u running with --enable-debug?). ass foo { function affiche_dict() { // $toto = 1; $this->dict["date_message"] = $toto; while (list($key, $val) = each($this->dict)) {} } } uncommenting the $toto = 1 line will "cure" the mem-leaks. tc On Fri, 20 Aug 1999, Andrey Zmievski wrote: > christophe.massiot@mail.dotcom.fr wrote: > > The following script : > > > > <? > > class foo { > > function affiche_dict() { > > $this->dict[date_message] = $toto; > > while (list($key, $val) = each($this->dict)) {} > > } > > } > > $bar = new foo; > > $err = $bar->affiche_dict(); > > ?> > > > > produces : > > > > 1:22 [webase3:p3] titi:~/html% php test.php > > Content-Type: text/html > > > > test.php: Freeing 0x080F0308 (41 bytes), allocated in zend_hash.c on line > 175<br> > > test.php: Freeing 0x080F02B8 (35 bytes), allocated in zend_hash.c on line > 380<br> > > test.php: Freeing 0x080F5D48 (4 bytes), allocated in zend_hash.c on line > 391<br> > > > > The script works fine on my machine.. > > > -Andrey > Hacker: Any person who derives joy from > discovering ways to circumvent limitations. > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!" Digital Collections Phone +49 40 235350 Fax +49 40 23535180 Hammerbrookstr. 93 20097 Hamburg / Germany

« previous php.version4 (#3610) next »