- Fixed PECL bug #11216 (crash in ZipArchive::addEmptyDir when a directory
already exists). (Pierre)
+- Fixed bug #42151 (__destruct functions not called after catching a SoapFault
+ exception). (Dmitry)
- Fixed bug #42142 (substr_replace() returns FALSE when length > string
length). (Ilia)
- Fixed bug #42135 (Second call of session_start() causes creation of SID).
#ifdef va_copy
va_list argcopy;
#endif
+ zend_object_store_bucket *old_objects;
int old = PG(display_errors);
INIT_ZVAL(outbuf);
INIT_PZVAL(exception);
zend_throw_exception_object(exception TSRMLS_CC);
+ old_objects = EG(objects_store).object_buckets;
+ EG(objects_store).object_buckets = NULL;
PG(display_errors) = 0;
zend_try {
call_old_error_handler(error_num, error_filename, error_lineno, format, args);
EG(in_execution) = _old_in_execution;
EG(current_execute_data) = _old_current_execute_data;
} zend_end_try();
+ EG(objects_store).object_buckets = old_objects;
PG(display_errors) = old;
zend_bailout();
} else {
--- /dev/null
+--TEST--
+Bug #42151 __destruct functions not called after catching a SoapFault exception
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+class foo {
+ function __construct(){
+ $foo = @ new SoapClient('httpx://');
+ }
+ 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";
+}
+echo "ok\n";
+?>
+--EXPECT--
+SOAP-ERROR: Parsing WSDL: Couldn't load from 'httpx://'
+ok
+I don't get executed either.