|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-05-10 10:11 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 30 10:00:01 2025 UTC |
Description: ------------ When a exception is throwed from a foreach, memory leak will happen Reproduce code: --------------- <?php try{ $ar = array(1, 2, 3); foreach($ar as $ele) { throw new Exception("new exception"); } } catch(Exception $e) { echo $e->getMessage()."\n"; } ?> Expected result: ---------------- new exception Actual result: -------------- new exception [Tue May 9 13:40:13 2006] Script: 'test.php' /home/xlchen/php-5.1.2/Zend/zend_execute.c(843) : Freeing 0x0847FD5C (16 bytes) , script=test.php [Tue May 9 13:40:13 2006] Script: 'test.php' /home/xlchen/php-5.1.2/Zend/zend_vm_execute.h(3370) : Freeing 0x0847FCAC (35 by tes), script=test.php /home/xlchen/php-5.1.2/Zend/zend_hash.c(383) : Actual location (location was rel ayed) Last leak repeated 2 times [Tue May 9 13:40:13 2006] Script: 'test.php' /home/xlchen/php-5.1.2/Zend/zend_vm_execute.h(3339) : Freeing 0x0846D054 (16 by tes), script=test.php Last leak repeated 2 times [Tue May 9 13:40:13 2006] Script: 'test.php' /home/xlchen/php-5.1.2/Zend/zend_vm_execute.h(3320) : Freeing 0x084809AC (32 by tes), script=test.php /home/xlchen/php-5.1.2/Zend/zend_hash.c(169) : Actual location (location was rel ayed) Last leak repeated 1 time === Total 9 memory leaks detected ===