xref: /PHP-8.2/ext/zend_test/tests/gh10695_2.phpt (revision b3e33be4)
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}(Object(Exception))
17#1 {main}
18  thrown in %s on line %d
19