1--TEST--
2Generator::throw() where the exception is caught in the generator
3--FILE--
4<?php
5
6function gen() {
7    echo "before yield\n";
8    try {
9        yield;
10    } catch (RuntimeException $e) {
11        echo $e, "\n\n";
12    }
13
14    yield 'result';
15}
16
17$gen = gen();
18var_dump($gen->throw(new RuntimeException('Test')));
19
20?>
21--EXPECTF--
22before yield
23RuntimeException: Test in %s:%d
24Stack trace:
25#0 {main}
26
27string(6) "result"
28