ID: 34065
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Assigned
+Status: Closed
Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 6CVS, 5CVS (2005-08-23)
Assigned To: dmitry
New Comment:
Fixed in CVS HEAD and PHP_5_2.
Previous Comments:
------------------------------------------------------------------------
[2006-08-28 09:20:40] [EMAIL PROTECTED]
See also bug #38623
------------------------------------------------------------------------
[2005-08-10 12:06:16] [EMAIL PROTECTED]
Description:
------------
Throwing exception from inside a foreach block can produce memory
leaks, because ZEND_SWITCH_FREE opcode is not executed.
Reproduce code:
---------------
<?php
$data = file(__FILE__);
try {
foreach ($data as $line) {
throw new Exception("error");
}
} catch (Exception $e) {
echo "ok\n";
}
?>
Expected result:
----------------
ok
Actual result:
--------------
memory leaks
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34065&edit=1