mirror of
https://github.com/php/doc-en.git
synced 2026-03-23 23:32:18 +01:00
This is already documented as a user note, but the note does not explain
what happens if both exceptions already have a previous exception.
Here is what I believe is the related piece of code:
```
/* Chain potential exception from wrapping finally block */
if (Z_OBJ_P(fast_call)) {
if (ex) {
if (zend_is_unwind_exit(ex) || zend_is_graceful_exit(ex)) {
/* discard the previously thrown exception */
OBJ_RELEASE(Z_OBJ_P(fast_call));
} else {
zend_exception_set_previous(ex, Z_OBJ_P(fast_call));
}
} else {
ex = EG(exception) = Z_OBJ_P(fast_call);
}
}
```
The note: https://www.php.net/manual/en/language.exceptions.php#129177