1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-23 23:32:18 +01:00
Files
archived-doc-en/language
Grégoire Paris ed956d714e 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#129177
2025-06-23 14:41:19 -07:00
..
2009-06-14 22:03:29 +00:00
2025-03-18 08:18:45 -07:00
2023-05-16 21:41:31 +01:00