1--TEST--
2Impossible to yield from a generator which already failed, nested version
3--FILE--
4<?php
5
6function from() {
7    yield 0;
8    throw new Exception();
9}
10function gen($gen) {
11    yield from $gen;
12}
13
14$gen1 = from();
15$gen2 = gen($gen1);
16$gen3 = gen($gen1);
17try {
18    $gen2->next();
19} catch (Exception $e) {
20    unset($gen2);
21}
22$gen3->next();
23
24?>
25--EXPECTF--
26Fatal error: Uncaught Error: Generator passed to yield from was aborted without proper return and is unable to continue in %s:%d
27Stack trace:
28#0 [internal function]: gen(Object(Generator))
29#1 %s(%d): Generator->next()
30#2 {main}
31  thrown in %s on line %d
32