[php-src] Issue #20714: Regression: Uncatchable exception

[email protected] (greg0ire)
Newsgroups php.bugs
Message-ID <[email protected]>
Issue: https://github.com/php/php-src/issues/20714
Author: greg0ire

### Description

The following code:

```php
<?php
function gen(): Generator
{
    try {
        yield 1;
    } finally {
    }
}

function process(): void
{
    $g = gen();
    foreach ($g as $_) {
        throw new Exception('ERROR');
    }
}

try {
    process();
} catch (Exception $e) {
    echo "Caught\n";
}
```

Resulted in this output:
```
Fatal error: Uncaught Exception: ERROR in /in/a8M88:15
Stack trace:
#0 /in/a8M88(20): process()
#1 {main}
  thrown in /in/a8M88 on line 15

Process exited with code 255.
```

But I expected this output instead:
```
Caught
```


This works with PHP 8.4.14, and it does not work with PHP 8.4.15

### PHP Version

```plain
PHP 8.4.15 (cli) (built: Nov 18 2025 17:26:05) (NTS gcc x86_64)
Copyright (c) The PHP Group
Built by Fedora Project
Zend Engine v4.4.15, Copyright (c) Zend Technologies
```

### Operating System

_No response_
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.