xref: /php-src/ext/zend_test/tests/gh10695_2.phpt (revision 08b2ab22)
1--TEST--
2GH-10695: Uncaught exception in exception handler catching resource dtor exception
3--EXTENSIONS--
4zend_test
5--FILE--
6<?php
7set_exception_handler(function (\Throwable $exception) {
8    throw new Exception('Caught');
9});
10
11$resource = zend_test_create_throwing_resource();
12?>
13--EXPECTF--
14Fatal error: Uncaught Exception: Caught in %s:%d
15Stack trace:
16#0 [internal function]: {closure:%s:%d}(Object(Exception))
17#1 {main}
18  thrown in %s on line %d
19