1--TEST--
2Observer: fatal errors caught with zend_try will not fire end handlers prematurely
3--EXTENSIONS--
4zend_test
5soap
6--INI--
7zend_test.observer.enabled=1
8zend_test.observer.show_output=1
9zend_test.observer.observe_all=1
10zend_test.observer.show_return_value=1
11--FILE--
12<?php
13function foo()
14{
15    // ext/soap catches a zend_bailout and then throws an exception
16    $client = new SoapClient('foo');
17}
18
19function main()
20{
21    foo();
22}
23
24// try/catch is on main() to ensure ZEND_HANDLE_EXCEPTION does not fire the end handlers again
25try {
26    main();
27} catch (SoapFault $e) {
28    echo $e->getMessage() . PHP_EOL;
29}
30
31echo 'Done.' . PHP_EOL;
32?>
33--EXPECTF--
34<!-- init '%s%eobserver_error_%d.php' -->
35<file '%s%eobserver_error_%d.php'>
36  <!-- init main() -->
37  <main>
38    <!-- init foo() -->
39    <foo>
40      <!-- Exception: SoapFault -->
41    </foo:NULL>
42    <!-- Exception: SoapFault -->
43  </main:NULL>
44SOAP-ERROR: Parsing WSDL: %s
45
46Done.
47</file '%s%eobserver_error_%d.php'>
48