1--TEST--
2Free pending exceptions / return values on clone on yield in finally
3--FILE--
4<?php
5function gen1() {
6    try {
7        throw new Exception();
8    } finally {
9        yield;
10    }
11}
12function gen2() {
13    try {
14        $bar = "bar";
15        return "foo" . $bar;
16    } finally {
17        yield;
18    }
19}
20function gen3() {
21    try {
22        throw new Exception();
23    } finally {
24        try {
25            $bar = "bar";
26            return "foo" . $bar;
27        } finally {
28            yield;
29        }
30    }
31}
32function gen4() {
33    try {
34        try {
35            $bar = "bar";
36            return "foo" . $bar;
37        } finally {
38            yield;
39        }
40    } finally {
41    }
42}
43gen1()->rewind();
44gen2()->rewind();
45gen3()->rewind();
46gen4()->rewind();
47
48?>
49===DONE===
50--EXPECT--
51===DONE===
52