|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-08-28 09:20 UTC] dmitry@php.net
[2006-09-19 21:44 UTC] dmitry@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
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