1--TEST--
2Printing the stack trace in a generator
3--FILE--
4<?php
5
6function f1() {
7    debug_print_backtrace();
8}
9
10function f2($arg1, $arg2) {
11    f1();
12    yield; // force generator
13}
14
15function f3($gen) {
16    $gen->rewind(); // trigger run
17}
18
19$gen = f2('foo', 'bar');
20f3($gen);
21
22?>
23--EXPECTF--
24#0 %s(%d): f1()
25#1 [internal function]: f2('foo', 'bar')
26#2 %s(%d): Generator->rewind()
27#3 %s(%d): f3(Object(Generator))
28