xref: /PHP-8.1/Zend/tests/bug60909_2.phpt (revision 7aacc705)
1--TEST--
2Bug #60909 (custom error handler throwing Exception + fatal error = no shutdown function).
3--FILE--
4<?php
5register_shutdown_function(function(){echo("\n\n!!!shutdown!!!\n\n");});
6
7class Bad {
8    public function __toString() {
9        throw new Exception('I CAN DO THIS');
10    }
11}
12
13$bad = new Bad();
14echo "$bad";
15?>
16--EXPECTF--
17Fatal error: Uncaught Exception: I CAN DO THIS in %s:%d
18Stack trace:
19#0 %s(%d): Bad->__toString()
20#1 {main}
21  thrown in %s on line %d
22
23
24!!!shutdown!!!
25