ID: 34065
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Assigned
Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 6CVS, 5CVS (2005-08-23)
Assigned To: dmitry
New Comment:
See also bug #38623
Previous Comments:
------------------------------------------------------------------------
[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