#42151 [Asn->Csd]: __destruct functions not called after catching a SoapFault exception

From: Date: Wed, 01 Aug 2007 10:40:08 +0000
Subject: #42151 [Asn->Csd]: __destruct functions not called after catching a SoapFault exception
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115629@lists.php.net to get a copy of this message
ID: 42151 Updated by: dmitry@php.net Reported By: mattsch at gmail dot com -Status: Assigned +Status: Closed Bug Type: SOAP related Operating System: Gentoo Linux PHP Version: 5.2.3 Assigned To: dmitry New Comment: 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 http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2007-07-30 22:24:29] mattsch at gmail dot com Description: ------------ All __destruct functions of all objects in memory are not called if a SoapFault exception is thrown and caught. Reproduce code: --------------- <?php class foo { function __construct(){ $foo = new SoapClient('http://php.net/problem_file.wsdl'); } 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 'http://php.net/problem_file.wsdl' I never get executed. I don't get executed either. Actual result: -------------- SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://php.net/problem_file.wsdl' ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42151&edit=1

« previous php.bugs (#115629) next »