Bug #76982 [Com]: memory leak declaring closure in included file

From: Date: Wed, 06 Oct 2021 09:23:39 +0000
Subject: Bug #76982 [Com]: memory leak declaring closure in included file
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-237062@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76982&edit=1 ID: 76982 Comment by: michael dot vorisek at email dot cz Reported by: ryan dot brothers at gmail dot com Summary: memory leak declaring closure in included file Status: Verified Type: Bug Package: Scripting Engine problem Operating System: Linux PHP Version: 7.2.10 Block user comment: N Private report: N New Comment: if (!class_exists(Test::class)) { class Test { } } is leaking too, even if the the if condition is satisfied only once, test https://github.com/php/php-src/pull/7562/files . Seems to be fixed in PHP 8.1, but only when opcache is enabled (which is not by default for CLI). Previous Comments: ------------------------------------------------------------------------ [2021-08-16 10:21:19] nikic@php.net Related To: Bug #81361 ------------------------------------------------------------------------ [2021-04-09 21:43:52] zoohie at gmail dot com Problem occurs not only with closures but also with anonymous classes. ------------------------------------------------------------------------ [2021-03-01 10:44:06] nikic@php.net This leak is partially fixed in PHP 8.1. There's still a memory leak, but it's a constant leak of ~250 bytes per overwritten closure now. ------------------------------------------------------------------------ [2021-02-19 17:16:45] nikic@php.net The following pull request has been associated: Patch Name: Reference dynamic functions through dynamic_defs On GitHub: https://github.com/php/php-src/pull/5595 Patch: https://github.com/php/php-src/pull/5595.patch ------------------------------------------------------------------------ [2021-02-19 17:16:06] nikic@php.net Related To: Bug #80777 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=76982 -- Edit this bug report at https://bugs.php.net/bug.php?id=76982&edit=1

« previous php.bugs (#237062) next »