php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80045 memleak after two set_exception_handler calls with __call
Submitted: 2020-09-03 07:10 UTC Modified: -
From: [email protected] Assigned:
Status: Closed Package: *General Issues
PHP Version: 8.0.0beta2 OS: archLinux
Private report: No CVE-ID: None
 [2020-09-03 07:10 UTC] [email protected]
Description:
------------
php8 reports a memleak after two set_exception_handler calls combined with an __call

Test script:
---------------
class x {
	public function __construct(){
		$h = set_exception_handler([$this, 'dummyExceptionHandler']);
		$h = set_exception_handler([$this, 'dummyExceptionHandler']);
	}

	public function __call($m, $p) {}
}

new x;

Actual result:
--------------
php-8.0.0beta2/Zend/zend_object_handlers.c(1120) :  Freeing 0x00007fd2ab25d780 (232 bytes), script=/tmp/memleak.php
=== Total 1 memory leaks detected ===


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-03 08:31 UTC] [email protected]
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 31 22:00:02 2026 UTC