Commit ed956d7
authored
Document exception chaining (#3855)
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#1291771 parent 1651836 commit ed956d7
1 file changed
+38
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
| |||
359 | 365 | | |
360 | 366 | | |
361 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
362 | 400 | | |
363 | 401 | | |
364 | 402 | | |
| |||
0 commit comments