php-src/Zend/tests/gh10695_2.phpt
Ilija Tovilo b3e33be443
Forward shutdown exceptions to user error handlers
Fixes GH-10695
Closes GH-110905
2023-06-15 17:11:22 +02:00

19 lines
360 B
PHP

--TEST--
GH-10695: Exceptions in destructor during shutdown are caught
--FILE--
<?php
class Foo {
public function __destruct() {
throw new \Exception(__METHOD__);
}
}
set_exception_handler(function (\Throwable $exception) {
echo 'Caught: ' . $exception->getMessage() . "\n";
});
const FOO = new Foo;
?>
--EXPECT--
Caught: Foo::__destruct