|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-09-10 21:49 UTC] cunha17 at uol dot com dot br
[2003-09-14 15:20 UTC] helly@php.net
[2003-09-14 15:32 UTC] cunha17 at uol dot com dot br
[2003-09-14 15:57 UTC] helly@php.net
[2003-09-14 15:58 UTC] helly@php.net
[2010-11-02 15:45 UTC] kgrecki at gmail dot com
[2010-11-02 17:26 UTC] felipe@php.net
[2010-11-02 18:50 UTC] kgrecki at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 15:00:01 2025 UTC |
Description: ------------ This code below gives some memory leak. The leak only appears when throwing exceptions inside error handler. The code I'm using is a little more complex 'cause it translates PHP errors into PHP Exceptions, but this piece of code reproduces the leak correctly. Reproduce code: --------------- <? function my_error($nr, $text, $file, $line, $vars) { throw new Exception($text); } error_reporting(E_ALL); set_error_handler("my_error"); try { include("unexistent"); } catch (Exception $e) { echo "EXCEPTION!!!"; } ?> Expected result: ---------------- EXCEPTION!!! Actual result: -------------- EXCEPTION!!!/usr/src/zend2/php-src/Zend/zend.c(914) : Freeing 0x404C9340 (16 bytes), script=leak.php === Total 1 memory leaks detected ===