xref: /php-src/Zend/tests/gh10695_4.phpt (revision 08b2ab22)
1--TEST--
2GH-10695: Exception handlers are not called twice
3--FILE--
4<?php
5set_exception_handler(function (\Throwable $exception) {
6    echo 'Caught: ' . $exception->getMessage() . "\n";
7    throw new \Exception('exception handler');
8});
9
10throw new \Exception('main');
11?>
12--EXPECTF--
13Caught: main
14
15Fatal error: Uncaught Exception: exception handler in %s:%d
16Stack trace:
17#0 [internal function]: {closure:%s:%d}(Object(Exception))
18#1 {main}
19  thrown in %s on line %d
20