|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42151 __destruct functions not called after catching a SoapFault exception
Submitted: 2007-07-30 22:24 UTC Modified: 2007-08-01 10:40 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mattsch at gmail dot com Assigned: dmitry (profile)
Status: Closed Package: SOAP related
PHP Version: 5.2.3 OS: Gentoo Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mattsch at gmail dot com
New email:
PHP Version: OS:


 [2007-07-30 22:24 UTC] mattsch at gmail dot com
All __destruct functions of all objects in memory are not called if a SoapFault exception is thrown and caught.

Reproduce code:
class foo {
	function __construct(){
		$foo = new SoapClient('');
	function __destruct(){
		echo 'I never get executed.' . "\n";
class bar {
	function __destruct(){
		echo 'I don\'t get executed either.' . "\n";
try {
	$bar = new bar();
	$foo = new foo();
} catch (Exception $e){
	echo $e->getMessage() . "\n";

Expected result:
SOAP-ERROR: Parsing WSDL: Couldn't load from ''
I never get executed.
I don't get executed either.

Actual result:
SOAP-ERROR: Parsing WSDL: Couldn't load from ''


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-01 10:40 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 22 05:01:30 2024 UTC