xref: /PHP-7.3/ext/soap/tests/bugs/bug42151.phpt (revision 610c7fbe)
1--TEST--
2Bug #42151 (__destruct functions not called after catching a SoapFault exception)
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--FILE--
6<?php
7class foo {
8	function __construct(){
9		$foo = @ new SoapClient('httpx://');
10	}
11	function __destruct(){
12		echo 'I never get executed.' . "\n";
13	}
14}
15class bar {
16	function __destruct(){
17		echo 'I don\'t get executed either.' . "\n";
18	}
19}
20try {
21	$bar = new bar();
22	$foo = new foo();
23} catch (Exception $e){
24	echo $e->getMessage() . "\n";
25}
26echo "ok\n";
27?>
28--EXPECT--
29SOAP-ERROR: Parsing WSDL: Couldn't load from 'httpx://' : failed to load external entity "httpx://"
30
31ok
32I don't get executed either.
33