xref: /PHP-8.4/Zend/tests/gh10695_2.phpt (revision b3e33be4)
1--TEST--
2GH-10695: Exceptions in destructor during shutdown are caught
3--FILE--
4<?php
5class Foo {
6    public function __destruct() {
7        throw new \Exception(__METHOD__);
8    }
9}
10
11set_exception_handler(function (\Throwable $exception) {
12    echo 'Caught: ' . $exception->getMessage() . "\n";
13});
14
15const FOO = new Foo;
16?>
17--EXPECT--
18Caught: Foo::__destruct
19