1--TEST--
2try { return } finally { return } in generator
3--FILE--
4<?php
5
6function gen() {
7    try {
8        try {
9            echo "before return\n";
10            return;
11            echo "after return\n";
12        } finally {
13            echo "before return in inner finally\n";
14            return;
15            echo "after return in inner finally\n";
16        }
17    } finally {
18        echo "outer finally run\n";
19    }
20
21    echo "code after finally\n";
22
23    yield; // force generator
24}
25
26$gen = gen();
27$gen->rewind(); // force run
28
29?>
30--EXPECTF--
31before return
32before return in inner finally
33outer finally run
34