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

From: Date: Tue, 31 Jul 2007 12:38:34 +0000
Subject: #42151 [Opn->Asn]: __destruct functions not called after catching a SoapFault exception
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115595@lists.php.net to get a copy of this message
ID: 42151 Updated by: iliaa@php.net Reported By: mattsch at gmail dot com -Status: Open +Status: Assigned Bug Type: SOAP related Operating System: Gentoo Linux PHP Version: 5.2.3 -Assigned To: +Assigned To: dmitry 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 (#115595) next »